Skip to content

Instantly share code, notes, and snippets.

Rikaard Hosein rikaardhosein

Block or report user

Report or block rikaardhosein

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am rikaardhosein on github.
  • I am rikaardhosein (https://keybase.io/rikaardhosein) on keybase.
  • I have a public key ASA3d_ek8Q6mOMfI0mpJPdyqA6HlUPtV0Tm7aTvhcKuwaAo

To claim this, I am signing this object:

View dctf-crypto350.py
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)
View key_calc.py
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)]
View 200pwn.py
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)
View crypto200.py
#!/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')
View encrypter.py
#!/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)]
View hackyou_crypto300.py
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)
View dec.py
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])])
View crypto.py
#!/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):
View key_gen.py
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)
You can’t perform that action at this time.