MCPcopy
hub / github.com/1Panel-dev/MaxKB / decrypt

Function decrypt

apps/common/utils/rsa_util.py:79–90  ·  view source on GitHub ↗

解密 :param msg: 需要解密的数据 :param pri_key: 私钥 :return: 解密后数据

(msg, pri_key: str | None = None)

Source from the content-addressed store, hash-verified

77
78
79def decrypt(msg, pri_key: str | None = None):
80 """
81 解密
82 :param msg: 需要解密的数据
83 :param pri_key: 私钥
84 :return: 解密后数据
85 """
86 if pri_key is None:
87 pri_key = get_key_pair().get('value')
88 cipher = _get_cipher(pri_key)
89 decrypt_data = cipher.decrypt(base64.b64decode(msg), 0)
90 return decrypt_data.decode("utf-8")
91
92
93

Callers 6

saveMethod · 0.90
re_passwordMethod · 0.90
loginMethod · 0.90
postMethod · 0.90
postMethod · 0.90
_decryptFunction · 0.90

Calls 4

_get_cipherFunction · 0.85
decodeMethod · 0.80
get_key_pairFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected