Skip to content

Instantly share code, notes, and snippets.

View nagarjune's full-sized avatar
🎯
Focusing

Nagarjun E nagarjune

🎯
Focusing
View GitHub Profile
@nagarjune
nagarjune / AESCipher.py
Created March 10, 2019 15:43 — 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])]