Package-Level Type Names (total 3, all are exported)
/* sort exporteds by: | */
Answer is result of SRP algorithm. A parameter (see SRP) M1 parameter (see SRP)
func SRP.Hash(password, srpB, random []byte, i Input) (Answer, error)
Input is hashing algorithm parameters from server.
Copy of tg.PasswordKdfAlgoSHA256SHA256PBKDF2HMACSHA512iter100000SHA256ModPow Base (see SRP 2FA login¹)
Links:
1) https://core.telegram.org/api/srp 2048-bit modulus (see SRP 2FA login¹)
Links:
1) https://core.telegram.org/api/srp One of two salts used by the derivation function (see SRP 2FA login¹)
Links:
1) https://core.telegram.org/api/srp One of two salts used by the derivation function (see SRP 2FA login¹)
Links:
1) https://core.telegram.org/api/srp
func SRP.Hash(password, srpB, random []byte, i Input) (Answer, error)
func SRP.NewHash(password []byte, i Input) (hash, newSalt []byte, _ error)
SRP is client implementation of Secure Remote Password protocol.
See https://core.telegram.org/api/srp.randomio.Reader Hash computes user password hash using parameters from server.
See https://core.telegram.org/api/srp#checking-the-password-with-srp. 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.( SRP) bigExp(x, y, m *big.Int) *big.Int( SRP) bigFromBytes(b []byte) *big.Int computeXV computes following numbers
`x = PH2(password, salt1, salt2)`
`v = pow(g, x) mod p`
TDLib uses terms `clientSalt` for `salt1` and `serverSalt` for `salt2`. The main hashing function H is sha256:
H(data) := sha256(data)( SRP) pad256(b []byte) [256]byte( SRP) pad256FromBig(i *big.Int) (b [256]byte, r bool)( SRP) pbkdf2(ph1, salt1 []byte, n int) []byte The primary password hashing function is defined as follows:
PH1(password, salt1, salt2) := SH(SH(password, salt1), salt2) The salting hashing function SH is defined as follows:
SH(data, salt) := H(salt | data | salt) The secondary password hashing function is defined as follows:
PH2(password, salt1, salt2) := SH(pbkdf2(sha512, PH1(password, salt1, salt2), salt1, 100000), salt2)
func NewSRP(random io.Reader) SRP
Package-Level Functions (total 3, in which 1 is exported)
The pages are generated with Goldsv0.6.7. (GOOS=linux GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.