What opens openssl_seal:
- Extract public_key from certificate
- Generate 128 bits (16 bytes) long random_key (this will be used to encrypt the message using a symmetric algorithm, since it is faster)
- Encrypt random_card with PKCS # 1
- Encrypt message with ARC4 and random_key
- Print encrypted_random_key and encrypted_message
The receiving party can then decrypt encrypted_random_key with its private_key, and then decrypt the encrypted_ value with random_key.
Since in Python there is no way to do this through the standard library, I'm just going to throw away the three approaches I tried:
# pyca/cryptography (cryptography.io) version
.
# M2Crypto version # pip install pip install git+https:
.
# PyCrypto version
You can check my post at => http://helpfulsheep.com/2017-09-01-openssl-seal-in-python/
Gabi nagy
source share