Skip to content

Instantly share code, notes, and snippets.

Mariano Guezuraga mguezuraga

View GitHub Profile
View medium_one_impersonation.py
import base64
import datetime
import hashlib
import logging
import sys
import xmlrpc.client
from Crypto.Cipher import AES
from lxml import etree
View medium_one_ruby_cipher.py
import base64
import hashlib
from Crypto.Cipher import AES
BS = 16
key = '74cf0e9a3c2b904e9c445771cdccb3e6ce3e4da7'
def pad(s): return s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
View medium_one_ruby_cipher.rb
require 'openssl'
require 'digest/sha1'
require 'base64'
@key = Digest::SHA1.hexdigest('74cf0e9a3c2b904e9c445771cdccb3e6ce3e4da7')
@cipher = OpenSSL::Cipher::Cipher.new('aes-256-cbc')
def encrypt(data)
@cipher.encrypt
View mguezuraga.rb
require 'openssl'
require 'digest/sha1'
require 'base64'
@cipher = OpenSSL::Cipher.new('aes-256-cbc')
def encrypt(data, key)
@cipher.encrypt
@cipher.key = key
@mguezuraga
mguezuraga / AESCipher.py
Last active Feb 24, 2020 — forked from swinton/AESCipher.py
Encrypt & Decrypt using PyCrypto AES 256From http://stackoverflow.com/a/12525165/119849
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:-s[-1]]
You can’t perform that action at this time.