Skip to content

Instantly share code, notes, and snippets.

View parikh5555's full-sized avatar
🎯
Focusing

Abhishek Parikh parikh5555

🎯
Focusing
  • Innvonix Tech Solutions Limited
  • Ahmedabad
View GitHub Profile
@parikh5555
parikh5555 / AESCipher.py
Created September 5, 2016 06:14 — 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])]
@parikh5555
parikh5555 / gist:20d577de979823f333b21edd64e69422
Created August 22, 2016 13:15
Python AES two-way encryption/decryption example
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
@parikh5555
parikh5555 / webserver.js
Last active July 29, 2016 10:23 — forked from hectorcorrea/webserver.js
web server in node.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) {