Python pyOpenssl, encryption/decryption how to use this module properly? python 3

Viewed 53

I am using OpenSSL to decrypt/encrypt strings or at least trying to. But I can't for the love of god figure out how to use this module, I can't get any info from the documentation and there are no videos explaining anything.

This is pretty much just pseudo code that doesn't work at all of what I am trying to do.

from OpenSSL import SSL
Plaintext = "just a text"
Ciphertext = ""
iv = OpenSSL.crypto.iv("aabbccddeeff00998877665544332211")
key = OpenSSL.crypto.PKey("58703273357638792F423F4528482B4B") 
ciphier = OpenSSL.crypto.crypto.AES.new(key, AES.MODE_CBC,iv)
Ciphiertext = ciphier.OpenSSL.crypto.encrypt(Plaintext)

Bonus question: Is there another python module that uses Openssl?

0 Answers
Related