Skip to content

Instantly share code, notes, and snippets.

View seLain's full-sized avatar
😭
life is tough

Victor Hu seLain

😭
life is tough
View GitHub Profile
@seLain
seLain / AESCipher.py
Last active October 7, 2017 13:35 — forked from mguezuraga/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256From http://stackoverflow.com/a/12525165/119849
#!/usr/bin/env python
import base64
from Crypto import Random
from Crypto.Cipher import AES
import hashlib
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)