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
from Crypto.PublicKey import pubkey | |
from Crypto.Util import number | |
import fractions | |
import sys | |
MIN_SEED = int(sys.argv[1]) | |
MAX_SEED = int(sys.argv[2]) | |
SEED = MAX_SEED |
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
from Crypto.PublicKey import pubkey | |
from Crypto.Util import number | |
from Crypto.PublicKey import RSA | |
from Crypto.PublicKey import _slowmath | |
import fractions | |
import sys | |
import os | |
e = long(65537) | |
p = long(13097286606179453667665592444299109782484218865253457545521978739889248320232481682880143106432871469494586765663594908396375009598486558938138835723794021) |
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/python | |
import hashlib, string, sys | |
ROUNDS = 20000 | |
def xor(a, b): | |
l = min(len(a), len(b)) | |
return ''.join([chr(ord(x) ^ ord(y)) for x,y in zip(a[:l], b[:l])]) | |
def h(x): |
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 hashlib, string, sys | |
def h(x): | |
x = hashlib.sha256(x).digest() | |
x = xor(x[:16], x[16:]) | |
return x | |
def xor(a, b): | |
l = min(len(a), len(b)) | |
return ''.join([chr(ord(x) ^ ord(y)) for x, y in zip(a[:l], b[:l])]) |
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
from scipy import linalg | |
import numpy as np | |
from struct import pack,unpack | |
import sys | |
filename = 'flag.wmv' if len(sys.argv)==1 else sys.argv[1] | |
m_transform = np.frompyfunc(lambda x: int(round(x)),1,1) |
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/python | |
import random | |
from struct import pack | |
from struct import unpack | |
from scipy import linalg | |
def Str2matrix(s): | |
#convert string to 4x4 matrix | |
return [map(lambda x : ord(x), list(s[i:i+4])) for i in xrange(0, len(s), 4)] |
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/python | |
from math import sin | |
from urlparse import parse_qs | |
from base64 import b64encode | |
from base64 import b64decode | |
from re import match | |
SALT = '' | |
USERS = set() | |
KEY = ''.decode('hex') |
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 socket | |
import base64 | |
import itertools | |
from struct import pack,unpack | |
from math import sin | |
def get_cert(login_name): | |
#GET CERT | |
sock = socket.socket(socket.AF_INET,socket.SOCK_STREAM) |
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 | |
login = 'a'*500 | |
s = 'login=%s&role=anonymous' % login | |
cert = 'RK5yZMJaZTlcDXBExkxd5kV/HjX2iNltGZWvSmm9ykpsk2qByr9qdjBL8jqmBAEdlIRJoHRszQZlOVwNcETGTF3mRX8eNfaI2W0Zla9Kab3KSmyTaoHKv2p2MEvyOqYEAR2UhEmgdGzNBmU5XA1wRMZMXeZFfx419ojZbRmVr0ppvcpKbJNqgcq/anYwS/I6pgQBHZSESaB0bM0GZTlcDXBExkxd5kV/HjX2iNltGZWvSmm9ykpsk2qByr9qdjBL8jqmBAEdlIRJoHRszQZlOVwNcETGTF3mRX8eNfaI2W0Zla9Kab3KSmyTaoHKv2p2MEvyOqYEAR2UhEmgdGzNBmU5XA1wRMZMXeZFfx419ojZbRmVr0ppvcpKbJNqgcq/anYwS/I6pgQBHZSESaB0bM0GZTlcDXBExkxd5kV/HjX2iNltGZWvSmm9ykpsk2qByr9qdjBL8jqmBAEdlIRJoHRszQZlOVwNcETGTF3mRX8eNfaI2W0Zla9Kab3KSmyTaoHKv2p2MEvyOqYEAR2UhEmgdGzNBmU5XA1wRMZMXeZFfx419ojZbRmVr0ppvcpKbJNqgcq/anYwS/I6pgQBHZSESaB0bM0GZTlcDXBExkxd5kV/HjX2iNltGZWvSmm9ykpsk2qByr9qdjBL8jqmBAEdlIRJoHRszQYiKlIAdBjGQ1PpXXMQIeTQ22lMla8eau7JTTrFO9TP7D4uZUvxa/8EAknAhx2lLQ==' | |
cert_bytes = base64.b64decode(cert) | |
auth_str_bytes = cert_bytes[:len(s)] |
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
from z3 import * | |
ciphertext = "320b1c5900180a034c74441819004557415b0e0d1a316918011845524147384f5700264f48091e4500110e41030d1203460b1d0752150411541b455741520544111d0000131e0159110f0c16451b0f1c4a74120a170d460e13001e120a1106431e0c1c0a0a1017135a4e381b16530f330006411953664334593654114e114c09532f271c490630110e0b0b".decode("hex") | |
length = len(ciphertext) | |
ct = [ ord(ciphertext[i]) for i in range(0,length) ] | |
def encrypt(s): | |
c = [] | |
space = IntVal(0xa) |