使用key对password密文进行解密
(cipher_password, key)
| 46 | |
| 47 | |
| 48 | def decrypt(cipher_password, key): |
| 49 | """使用key对password密文进行解密""" |
| 50 | if cipher_password is None or cipher_password == "": |
| 51 | return cipher_password |
| 52 | if key is None: |
| 53 | raise ServerError(errcode.E_SERVER, "Decrypt key should not be none.") |
| 54 | key = __encode(key) |
| 55 | aes = pyaes.AESModeOfOperationCTR(key) |
| 56 | pwd = aes.decrypt(a2b_hex(cipher_password)) |
| 57 | return __decode(pwd) |
| 58 | |
| 59 | |
| 60 | def rsa_encrypt(plain_text, key): |
no test coverage detected