Skip to content

Instantly share code, notes, and snippets.

View SnollyG0st3r's full-sized avatar

SnollyG0st3r

View GitHub Profile
@SnollyG0st3r
SnollyG0st3r / AESCipher.py
Created October 30, 2018 12:10 — forked from swinton/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256 From http://stackoverflow.com/a/12525165/119849
#!/usr/bin/env python
import base64
from Crypto import Random
from Crypto.Cipher import AES
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]