Skip to content

Instantly share code, notes, and snippets.

@arambadk
arambadk / migrate_pycrypto_to_cryptography.md
Created March 21, 2018 00:00
Migrating from pycrypto to cryptography

I used pycrypto in my projects before but since the project is no longer under active development it is highly recommended to move to cryptography.

I faced some difficulty during this migration so I am documenting my solution to help others.

This is how my pycrypto code to get pem encoded key looked like

from Crypto.IO import PKCS8
from Crypto.IO import PEM

def key_stuff(key_file=None):