parent
ef3dd28a33
commit
3d9936b8a7
|
@ -1,9 +1,15 @@
|
||||||
|
try:
|
||||||
import Crypto.Hash.SHA256
|
import Crypto.Hash.SHA256
|
||||||
import Crypto.Cipher.AES
|
import Crypto.Cipher.AES
|
||||||
|
has_aes = True
|
||||||
|
except:
|
||||||
|
has_aes = False
|
||||||
|
|
||||||
class Crypter(object):
|
class Crypter(object):
|
||||||
ALIGNMENT = 16
|
ALIGNMENT = 16
|
||||||
def __init__(self, password, salt='aes.py'):
|
def __init__(self, password, salt='aes.py'):
|
||||||
|
if not has_aes:
|
||||||
|
raise Exception("pycrypto not installed")
|
||||||
self.password = password
|
self.password = password
|
||||||
self.salt = salt
|
self.salt = salt
|
||||||
self.hash = Crypto.Hash.SHA256.new(password + salt)
|
self.hash = Crypto.Hash.SHA256.new(password + salt)
|
||||||
|
|
Loading…
Reference in New Issue