Instantly share code, notes, and snippets.

# Carl Löndahlgrocid

• Sort options
Last active Oct 28, 2019
Exponentiation in GF2[x]/P(x)
View gf_mul.py
 import math poly = 0xa195150d15*2+1 degree = int(math.log(poly)/math.log(2)) f = (1 << degree) def multiply(a, b, poly): r = 0 for i in range(64): if ((a & (1 << i)) != 0):
Created Sep 20, 2019
SEC-T CTF appelgrens
View appelgrens.py
 from hashlib import sha256 from pwn import * s = remote("appelgrens-01.pwn.beer", 31337) user = "admin " print [sha256(user).digest().decode("cp1252")]
Created Sep 10, 2019
View gist:dcfd4b27021e3e2ee1f2ea335c97695d
 ### Keybase proof I hereby claim: * I am grocid on github. * I am grocidpriv (https://keybase.io/grocidpriv) on keybase. * I have a public key ASASb4aUwYxPzhf1sfYoanTnJkUBj8hZfXjiHO5oJptkBwo To claim this, I am signing this object:
Created Aug 25, 2019
CCCamp - Power
View solution.sage
Created Aug 25, 2019
CCCamp - Prejudiced randomness
View solve.py
 #!/usr/bin/env python2.7 import gmpy import random from pwn import * def legendre_symbol(a, p): ls = pow(a, (p - 1)/2, p) if ls == p - 1: return -1 return ls
Last active Jun 8, 2019
hsctf - multiplication service
View solve.py
 p = 2^448 - 2^224 - 1 F=GF(p) g=F(2) # use that k * (0, 2) = (0, 2^k), define this to be h h=F(260571191137716815341287411517193580203843541276741273922047807416174982227377817356425394246343714490986635819120516038840847423836513L) G=[] H=[] X=[] c=[] N=[2, 641, 18287, 196687, 1466449, 2916841, 6700417, 1469495262398780123809, 167773885276849215533569, 596242599987116128415063, 37414057161322375957408148834323969]
Last active May 23, 2019
View securityfestCTF19 - igiveemhell
 import os from Crypto.Util.strxor import strxor from Crypto.Cipher import AES from Crypto.Util.Padding import pad, unpad from pwn import * s = remote("igivethemhell-01.pwn.beer", 31337) s.readuntil("Welcome! Encrypted flag is ") data = s.recvline().strip() data = "0" * (len(data) % 2) + data
Created May 23, 2019
View securityfestCTF19 - infantrsa
 sage: n 808493201253189889201870335543001135601554189565265515581299663310211777902538379504356224725568544299684762515298676864780234841305269234586977253698801983902702103720999490643296577224887200359679776298145742186594264184012564477263982070542179129719002846743110253588184709450192861516287258530229754571 sage: e1=17612083435039538435027548324833878903098829050163163625471599511764464460956313942508578570555972697061266246 ....: 65037550324 sage: e2=85509398135110549659975585192919679892196893419532801558009960966070280825622376115029201294472843693778747885 ....: 6194680752 sage: a=621044266147023849688712506961435765257491308385958611483509212618354776698754113885283380553472029250381909907 ....: 10140004959309317986819737535171899175916096417020638046402928378953260206034110421868707877131961348498746384384 ....: 8774508968091261333459191715433931164437366476062407396306790590847798240200479849 sage: b=9099806794154189928468355733364094056780918756255539504959601116379706724690796267255777920618395
Created May 3, 2019
INS'HACK - crunchy