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.
Can you help me?
This is what openssl_seal()
does:
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With