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

Function _get_cipher

apps/common/utils/rsa_util.py:128–130  ·  view source on GitHub ↗

缓存 cipher 对象,避免重复创建

(pri_key: str)

Source from the content-addressed store, hash-verified

126
127@lru_cache(maxsize=2)
128def _get_cipher(pri_key: str):
129 """缓存 cipher 对象,避免重复创建"""
130 return PKCS1_cipher.new(RSA.importKey(pri_key, passphrase=secret_code))
131
132
133def rsa_long_decrypt(message, pri_key: str | None = None, length=256):

Callers 2

decryptFunction · 0.85
rsa_long_decryptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected