View medium_one_impersonation.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'openssl' | |
require 'digest/sha1' | |
require 'base64' | |
@cipher = OpenSSL::Cipher.new('aes-256-cbc') | |
def encrypt(data, key) | |
@cipher.encrypt | |
@cipher.key = key |
View AESCipher.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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]] |