MCPcopy Index your code
hub / github.com/HelloZeroNet/ZeroNet / pbkdf2

Function pbkdf2

src/lib/pyelliptic/hash.py:60–69  ·  view source on GitHub ↗
(password, salt=None, i=10000, keylen=64)

Source from the content-addressed store, hash-verified

58
59
60def pbkdf2(password, salt=None, i=10000, keylen=64):
61 if salt is None:
62 salt = OpenSSL.rand(8)
63 p_password = OpenSSL.malloc(password, len(password))
64 p_salt = OpenSSL.malloc(salt, len(salt))
65 output = OpenSSL.malloc(0, keylen)
66 OpenSSL.PKCS5_PBKDF2_HMAC(p_password, len(password), p_salt,
67 len(p_salt), i, OpenSSL.EVP_sha256(),
68 keylen, output)
69 return salt, output.raw

Callers

nothing calls this directly

Calls 2

randMethod · 0.80
mallocMethod · 0.80

Tested by

no test coverage detected