Skip to content

Instantly share code, notes, and snippets.

import os
import shutil
import random
listfile=['2bwm-git-2bwm-O0-f9579e061f6e200bc50fdae0d8f2a873.txt', '2bwm-git-2bwm-O1-f912e10f4da05c16416b15fc91cebab0.txt', '2bwm-git-2bwm-O2-78b862c439faaf310297881d8cb2ef6a.txt', '2bwm-git-2bwm-O3-24b389b88252b33cdb108afec106b5c3.txt', '2bwm-git-2bwm-Os-2376158d9aecb465e30ec25af58dfc44.txt', '9base-bc-O0-50b1dfb548c183eee821cd27b2ac6b88.txt', '9base-bc-O1-21b290de8f0d42f8e53737d004c71242.txt', '9base-bc-O2-4121f919f6fccec83b02ad902bb1618c.txt', '9base-bc-O3-35bc89081f6a4226b8746ea8b8cb1a69.txt', '9base-bc-Os-f0ba1119cc0b2034bc6439cf129de5fa.txt', '9base-grep-O0-81a969378731c2533f8666dfae523dae.txt', '9base-grep-O1-87cddd8bfd69f4a8fc48d80bd7636ccc.txt', '9base-grep-O2-082abc2a3e5592fa00c851e410fe66dd.txt', '9base-grep-O3-83fce87ee973d0e717e71e3020cc5b9d.txt', '9base-grep-Os-26150bbea563400c056c2f89a4938b57.txt', 'a4tech-bloody-driver-git-bloody-cli-O0-a54b4eb6a7491e8cf50f1dee287a0fb1.txt', 'a4tech-bloody-driver-git-bloody-cli-O1-a6fcaf4b539eb8df282b3ae1181124f2.txt', 'a
const [loginState,setLoginState]=useState();
const checkUser = async()=>{
const {data}= await supabase.from("users").select("*")
console.log(`data`,data)
}
const login = async() => {
setLoginState("Connecting to your wallet...");
if(!window.ethereum){
setLoginState("No MetaMask wallet ... Please install it");
#!/usr/local/bin/python
from Crypto.Cipher import AES
from Crypto.Util.number import long_to_bytes
from random import randint
from binascii import hexlify
with open('flag.txt','r') as f:
flag = f.read().strip()
SBOX = [0xb9, 0xb3, 0x49, 0x94, 0xf9, 0x3, 0xd0, 0xfc, 0x67, 0xa3, 0x72, 0xb5,
0x45, 0x82, 0x54, 0x93, 0x5b, 0x88, 0x5c, 0xe0,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3e,
0x42, 0x6b, 0xa1, 0x65, 0xb1, 0x57, 0x6c, 0x4, 0xff, 0xfd, 0x34, 0x40,
0x31, 0x8c, 0xbe, 0xda, 0x2c, 0x1b, 0x7c, 0x64, 0x3f, 0xd1, 0xc9, 0x9b,
0x25, 0x87, 0xaa, 0xd, 0x15, 0x1f, 0xce, 0x30, 0xfb, 0xd5, 0xef, 0xbb,
from string import *
def weird_function_1(s):
return sum([list(map(int,bin(ord(c))[2:].zfill(8))) for c in s], [])
def do_magic(OooO, B):
return sum(m * b for m, b in zip(weird_function_1(OooO), B))
B=[4267101277, 4946769145, 6306104881, 7476346548, 7399638140, 1732169972, 1236242271, 5109093704, 2163850849, 6552199249, 3724603395, 3738679916, 5211460878, 642273320, 3810791811, 761851628, 1552737836, 4091151711, 1601520107, 3117875577, 2485422314, 1983900485, 6150993150, 2045278518]
s=[34451302951,58407890177,49697577713,45443775595,38537028435,47069056666,49165602815,43338588490,32970122390]
flag=''
import random
import math
n = 24
def make_stuff():
A = []; b = [1, 10]
for i in range(n):
A.append(random.randint(*b))
b[False] = sum(A) + 1
from sock import Sock
from sage.all import *
so = Sock('crypto.2021.chall.actf.co:21601')
res = []
for i in range(100):
so.read_until(b"> ")
so.send_line(str(i))
res.append((i, int(so.read_line()[3:-1])))
for n in range(10, 100):
#!/usr/bin/python
from functools import reduce
with open("flag", "r") as f:
key = [ord(x) for x in f.read().strip()]
def substitute(value):
return (reduce(lambda x, y: x*value+y, key))%691
from sock import Sock
from binascii import hexlify, unhexlify
from itertools import product
class Cipher:
BLOCK_SIZE = 16
ROUNDS = 3
def __init__(self, key):
assert(len(key) == self.BLOCK_SIZE*self.ROUNDS)
self.key = key