Python中的openssl_seal() [英] openssl_seal() in Python

查看:113
本文介绍了Python中的openssl_seal()的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

要连接服务器,我发现使用PHP,我需要使用openssl_seal().可以,但是我想使用Python.我无法在等效函数中转换openssl_seal().

To connect a server, I've found that, using PHP, I need to use openssl_seal(). That's OK, but I want to use Python. I'm not able to convert openssl_seal() in an equivalent function.

你能帮我吗?

这是openssl_seal()的作用:

说明 int openssl_seal(字符串$ data,字符串& $ sealed_data,数组& $ env_keys, 数组$ pub_key_ids)

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.

推荐答案

this blogpost has a very detailed description of what's going on inside openssl_seal(). It also has an implementation in java.

据此,我认为使用

From this, I would think it should be relatively straightforward ("the proof left as an exercise to the reader" kind of straightforward) to do an equivalent implementation in python using pyopenssl, which includes RC4, or the newer, but for these purposes more focused tlslite.

这篇关于Python中的openssl_seal()的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆