Skip to content

Instantly share code, notes, and snippets.

View lduros's full-sized avatar

Loic Duros lduros

View GitHub Profile
@btall
btall / AESCipher.py
Last active January 13, 2021 02:06 — forked from crmccreary/AESCipher.py
Encryption using pycrypto, AES/ECB/PKCS5Padding
from Crypto.Cipher import AES
from Crypto import Random
BS = 16
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s: s[0:-ord(s[-1])]
class AESCipher:
def __init__(self, key):