MCPcopy Create free account
hub / github.com/PierreGode/Ragnar / scramble_native_password

Function scramble_native_password

pager_lib/pymysql/_auth.py:30–41  ·  view source on GitHub ↗

Scramble used for mysql_native_password

(password, message)

Source from the content-addressed store, hash-verified

28
29
30def scramble_native_password(password, message):
31 """Scramble used for mysql_native_password"""
32 if not password:
33 return b""
34
35 stage1 = sha1_new(password).digest()
36 stage2 = sha1_new(stage1).digest()
37 s = sha1_new()
38 s.update(message[:SCRAMBLE_LENGTH])
39 s.update(stage2)
40 result = s.digest()
41 return _my_crypt(result, stage1)
42
43
44def _my_crypt(message1, message2):

Callers

nothing calls this directly

Calls 3

_my_cryptFunction · 0.85
digestMethod · 0.45
updateMethod · 0.45

Tested by

no test coverage detected