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

Function rsa_decrypt

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

rsa 解密

(cipher_password, key, base64encode=True)

Source from the content-addressed store, hash-verified

63
64
65def rsa_decrypt(cipher_password, key, base64encode=True):
66 """rsa 解密"""
67 if base64encode:
68 cipher_password = b64decode(cipher_password)
69 key = RSA.importKey(key)
70 cipher = PKCS1_OAEP.new(key)
71 modBits = Crypto.Util.number.size(key.n)
72 k = Crypto.Util.number.ceil_div(modBits, 8)
73 message = b""
74 for i in range(0, len(cipher_password), k):
75 message += cipher.decrypt(cipher_password[i:i+k])
76 return message

Callers

nothing calls this directly

Calls 2

sizeMethod · 0.80
decryptMethod · 0.45

Tested by

no test coverage detected