Documentation ¶
Overview ¶
Package srp contains implementation of Secure Remote Password protocol.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct { // One of two salts used by the derivation function (see SRP 2FA login) Salt1 []byte // One of two salts used by the derivation function (see SRP 2FA login) Salt2 []byte // Base (see SRP 2FA login) G int // 2048-bit modulus (see SRP 2FA login) P []byte }
Input is hashing algorithm parameters from server.
Copy of tg.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow
type SRP ¶
type SRP struct {
// contains filtered or unexported fields
}
SRP is client implementation of Secure Remote Password protocol.
See https://core.telegram.org/api/srp.
func (SRP) Hash ¶
Hash computes user password hash using parameters from server.
See https://core.telegram.org/api/srp#checking-the-password-with-srp.
func (SRP) NewHash ¶
NewHash computes new user password hash using parameters from server.
See https://core.telegram.org/api/srp#setting-a-new-2fa-password.
TDLib implementation: See https://github.com/tdlib/td/blob/fa8feefed70d64271945e9d5fd010b957d93c8cd/td/telegram/PasswordManager.cpp#L57.
TDesktop implementation: See https://github.com/telegramdesktop/tdesktop/blob/v3.4.8/Telegram/SourceFiles/core/core_cloud_password.cpp#L68.