Skip to content

Instantly share code, notes, and snippets.

View shahinism's full-sized avatar
🌱
Shahining

Reza Khanipour shahinism

🌱
Shahining
View GitHub Profile
@shahinism
shahinism / AESCipher.py
Last active October 17, 2017 14:05 — forked from swinton/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256From http://stackoverflow.com/a/12525165/119849
import base64
from Crypto import Random
from Crypto.Cipher import AES
class AESCipher:
def __init__(self, key):
"""Key length should be of size 16, 24 or 32 based on AES function description
(eg. len(key) == 32 will provide AES256)