MCPcopy
hub / github.com/go-sql-driver/mysql / encryptPassword

Function encryptPassword

auth.go:220–229  ·  auth.go::encryptPassword
(password string, seed []byte, pub *rsa.PublicKey)

Source from the content-addressed store, hash-verified

218}
219
220func encryptPassword(password string, seed []byte, pub *rsa.PublicKey) ([]byte, error) {
221 plain := make([]byte, len(password)+1)
222 copy(plain, password)
223 for i := range plain {
224 j := i % len(seed)
225 plain[i] ^= seed[j]
226 }
227 sha1 := sha1.New()
228 return rsa.EncryptOAEP(sha1, rand.Reader, pub, plain, nil)
229}
230
231// authEd25519 does ed25519 authentication used by MariaDB.
232func authEd25519(scramble []byte, password string) ([]byte, error) {

Callers 2

sendEncryptedPasswordMethod · 0.85
authMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected