Instantly share code, notes, and snippets.

View AESCipher.py
#!/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])]
View gist:20d577de979823f333b21edd64e69422
from Crypto.Cipher import AES
import base64
import os
# the block size for the cipher object; must be 16, 24, or 32 for AES
BLOCK_SIZE = 32
# the character used for padding--with a block cipher such as AES, the value
# you encrypt must be a multiple of BLOCK_SIZE in length. This character is
# used to ensure that your value is always a multiple of BLOCK_SIZE
View webserver.js
var http = require("http");
var express = require("express")
var fs = require("fs")
var port = "8081";
var serverURL = "127.0.0.1";
var path = require("path")
console.log('Server running at ' + serverURL + ":" + port);
http.createServer(function (request, response) {