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

Function _get_encrypt_cipher

apps/common/utils/rsa_util.py:95–97  ·  view source on GitHub ↗

缓存加密 cipher 对象

(public_key: str)

Source from the content-addressed store, hash-verified

93
94@lru_cache(maxsize=2)
95def _get_encrypt_cipher(public_key: str):
96 """缓存加密 cipher 对象"""
97 return PKCS1_cipher.new(RSA.importKey(extern_key=public_key, passphrase=secret_code))
98
99
100def rsa_long_encrypt(message, public_key: str | None = None, length=200):

Callers 2

encryptFunction · 0.85
rsa_long_encryptFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected