parent
8ac72b0b25
commit
fe13c20dc1
2 changed files with 5 additions and 5 deletions
|
@ -153,7 +153,7 @@ def encrypt_all_m(key, iv, m, method, data):
|
|||
return b''.join(result)
|
||||
|
||||
|
||||
def dencrypt_all(password, method, data):
|
||||
def decrypt_all(password, method, data):
|
||||
result = []
|
||||
method = method.lower()
|
||||
(key_len, iv_len, m) = method_supported[method]
|
||||
|
@ -228,7 +228,7 @@ def test_encrypt_all_m():
|
|||
logging.warn(method)
|
||||
key, iv, m = gen_key_iv(b'key', method)
|
||||
cipher = encrypt_all_m(key, iv, m, method, plain)
|
||||
plain2, key, iv = dencrypt_all(b'key', method, cipher)
|
||||
plain2, key, iv = decrypt_all(b'key', method, cipher)
|
||||
assert plain == plain2
|
||||
|
||||
|
||||
|
|
|
@ -158,9 +158,9 @@ class UDPRelay(object):
|
|||
else:
|
||||
data = data[3:]
|
||||
else:
|
||||
data, key, iv = encrypt.dencrypt_all(self._password,
|
||||
self._method,
|
||||
data)
|
||||
data, key, iv = encrypt.decrypt_all(self._password,
|
||||
self._method,
|
||||
data)
|
||||
# decrypt data
|
||||
if not data:
|
||||
logging.debug(
|
||||
|
|
Loading…
Reference in a new issue