为了连接服务器,我发现使用PHP,我需要使用openssl_seal()
。没关系,但我想用Python。我无法在等效函数中转换openssl_seal()
。在
你能帮我吗?在
这就是openssl_seal()
的作用:
Description 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.
openssl_seal的作用是:
然后,接收方可以使用其私有密钥解密加密的随机密钥,然后使用随机密钥解密加密的密钥消息。在
由于在Python中无法通过标准库来实现这一点,我将“放弃我已经尝试过的3种方法:
一。在
^{pr2}$一。在
你可以在=>;http://helpfulsheep.com/2017-09-01-openssl-seal-in-python/上查看我的文章
this blogpost对
openssl_seal()
内部的情况有非常详细的描述。它还有一个java实现。在由此,我认为在python中使用pyopenssl(其中包括
RC4
)或更新的实现,应该相对简单(“将证明留给读者练习”有点直截了当),但是为了达到这些目的,tlslite更为集中。在相关问题 更多 >
编程相关推荐