Python中的openssl_seal()

ell*_*nne 6 python openssl

为了连接服务器,我发现使用PHP,我需要使用openssl_seal().没关系,但我想使用Python.我无法转换openssl_seal()为等效函数.

你能帮助我吗?

这是做什么的openssl_seal():

描述int openssl_seal(string $ data,string&$ sealed_data,array&$ env_keys,array $ pub_key_ids)

openssl_seal() seals (encrypts) data by using RC4 with a randomly generated
secret key. The key is encrypted with each of the public keys associated
with the identifiers in pub_key_ids and each encrypted key is returned in
env_keys. This means that one can send sealed data to multiple recipients
(provided one has obtained their public keys). Each recipient must receive
both the sealed data and the envelope key that was encrypted with the
recipient's public key.
Run Code Online (Sandbox Code Playgroud)

Ste*_*een 2

这篇博文对内部发生的情况进行了非常详细的描述openssl_seal()。它也有一个java实现。

由此看来,我认为使用pyopenssl在 python 中进行等效实现应该相对简单(“将证明留给读者作为练习” ,其中包括RC4或较新的版本,但出于这些目的更集中)tlslite