We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 345b0b1 commit feb4e40Copy full SHA for feb4e40
1 file changed
llluiop/0021/password.py
@@ -0,0 +1,23 @@
1
+#!/usr/bin/env python
2
+#-*- coding: utf-8-*-
3
+
4
5
6
+import os
7
+from hashlib import sha256
8
+from hmac import HMAC
9
10
+def encode(password):
11
+ salt = os.urandom(8)
12
+ print salt
13
14
+ result = password.encode("utf-8")
15
16
+ for i in range(10):
17
+ result = HMAC(result, salt, sha256).digest()
18
19
+ return result
20
21
+if __name__ == "__main__":
22
+ password = "password"
23
+ print encode(password)
0 commit comments