使用key对password密文进行解密
(cipher_password, key)
| 42 | |
| 43 | |
| 44 | def decrypt(cipher_password, key): |
| 45 | """使用key对password密文进行解密""" |
| 46 | if cipher_password is None: |
| 47 | return None |
| 48 | if key is None: |
| 49 | raise ServerError(errcode.E_SERVER, "Decrypt key should not be none.") |
| 50 | key = __encode(key) |
| 51 | aes = pyaes.AESModeOfOperationCTR(key) |
| 52 | pwd = aes.decrypt(a2b_hex(cipher_password)) |
| 53 | return __decode(pwd) |
no test coverage detected