MCPcopy Index your code
hub / github.com/Tencent/CodeAnalysis / decrypt

Function decrypt

server/projects/main/util/cdcrypto.py:48–57  ·  view source on GitHub ↗

使用key对password密文进行解密

(cipher_password, key)

Source from the content-addressed store, hash-verified

46
47
48def 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
60def rsa_encrypt(plain_text, key):

Callers 7

to_representationMethod · 0.90
refresh_tokenMethod · 0.90
authenticateMethod · 0.90
authenticateMethod · 0.90
decrypted_client_idMethod · 0.90
ScmClientFunction · 0.90

Calls 4

ServerErrorClass · 0.90
__encodeFunction · 0.70
__decodeFunction · 0.70
decryptMethod · 0.45

Tested by

no test coverage detected