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