Skip to content

Instantly share code, notes, and snippets.

@jspacek
jspacek / Graphing Example
Created February 5, 2019 01:53
Graphing Example
import pandas as pd
import numpy as np
import matplotlib.pyplot as plt
import matplotlib.patches as mpatches
import sys
sys.path.append('.')
from core import util
def proxy_exposure_boxplot():
"""
@jspacek
jspacek / decrypt.py
Created March 9, 2018 18:38
AES mini tool
from Crypto.Cipher import AES
import base64
def decrypt(ciphertext, key):
ciphertext = base64.b64decode(ciphertext)
cipher = AES.AESCipher(key, AES.MODE_ECB)
plaintext = cipher.decrypt(ciphertext)
return plaintext
def main():
@jspacek
jspacek / encrypt.py
Created March 9, 2018 18:30
AES mini tool
from Crypto.Cipher import AES
import base64
def pad(msg, blocksize):
padMsg = msg + " "*(blocksize-len(msg))
return padMsg[0:blocksize]
def encrypt(msg, key):
paddedMsg = pad(msg, 32);
cipher = AES.AESCipher(key, AES.MODE_ECB)