要连接服务器,我发现使用 PHP,我需要使用openssl_seal()
。没关系,但我想使用 Python。我无法转换openssl_seal()
在等效函数中。
你能帮助我吗?
这是什么openssl_seal()
does:
描述
int openssl_seal ( 字符串 $data , 字符串 &$sealed_data , 数组 &$env_keys ,
数组 $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.
这篇博文 https://web.archive.org/web/20151028220353/http://blog.local.ch/en/2007/10/29/openssl-php-to-java对里面发生的事情有非常详细的描述openssl_seal()
。它也有一个java实现。
由此看来,我认为在 python 中使用以下方法进行等效实现应该相对简单(“将证明作为练习留给读者”)pyopenssl https://launchpad.net/pyopenssl, 包括RC4
,或较新的,但对于这些目的更集中tlslite https://pypi.python.org/pypi/tlslite/0.4.4.
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)