We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 54d7e41 commit be3342dCopy full SHA for be3342d
webadmin/src/__init__.py
@@ -1,28 +1 @@
1
-import sha
2
-
3
__version__ = "1.6.6"
4
5
-def bin2long(s):
6
- return reduce( lambda x,y:(x<<8L)+y, map(ord, s))
7
8
-def long2bin(l):
9
- res = ""
10
- for byte in range(128):
11
- res += chr((l >> (1024 - (byte + 1) * 8)) & 0xff)
12
- return res
13
14
-def rsa_pub1024(src, mod):
15
- return long2bin(pow(bin2long(src), 65537, bin2long(mod)))
16
17
-def decrypt_block(src, mod):
18
- if len(src) != 128 and len(src) != 202:
19
- return None
20
- dest = rsa_pub1024(src[:128], mod)
21
- hash = sha.new(dest[1:107])
22
- if len(src) == 202:
23
- hash.update(src[131:192])
24
- result = hash.digest()
25
- if result == dest[107:127]:
26
- return dest
27
28
0 commit comments