Skip to content

Instantly share code, notes, and snippets.

View Zerk123's full-sized avatar

Zerk Shaban Zerk123

  • Software Engineer @ Arrivy Inc.
  • Lahore, Pakistan
View GitHub Profile
@Zerk123
Zerk123 / AESCipher.py
Created September 19, 2018 05:30 — 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])]