ecdh

TJCTF | curvature

#ECDH #InvalidCurveAttack #CRT 楕円曲線の位数がある程度小さい数を含むように素因数分解できる場合に、楕円曲線のgenerator * (order / factor)をやると、位数がfactorな部分群のgeneratorが求まる(位数を調整するテク)。あとは #CRT で復元 #!/usr/bin…

CSAW CTF Qualification Round 2019 | Supercurve

#ECDH #ECDLP """ supercurve.py An implementation of a weak elliptic curve over a prime field in standard Weirstrauss form: y^2 = x^3 + ax + b Derived from: https://github.com/andreacorbellini/ecc/blob/master/logs/common.py """ class SuperC…

PicoCTF 2018 | ECC2

#ECDH #ECDLP #Pohlig-Hellman_Attack Elliptic Curve: y^2 = x^3 + A*x + B mod M M = 93556643250795678718734474880013829509320385402690660619699653921022012489089 A = 660015981440128658766741155702689908063145067111045210367475336127984349047…

Google CTF 2021 | H1

#googlectf2021 #!/usr/bin/python3 import os import hashlib from cryptography.hazmat.backends import default_backend from cryptography.hazmat.primitives import padding from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, m…

nullcon HackIM 2019|Singular

#nullconHackIM2019 https://ctftime.org/task/7528 https://gitlab.com/n0tsobad/ctf-writeups/tree/master/2019-02-01-nullcon/Singular https://grosquildu.github.io/writeups/2019/01/03/nullcon-singular/ https://crypto.stackexchange.com/questions…

TJCTF 2016 | Curvature2

#ECDH from flag import FLAG FLAG = int(FLAG.encode('hex'),16) P = 0xd3ceec4c84af8fa5f3e9af91e00cabacaaaecec3da619400e29a25abececfdc9bd678e2708a58acb1bd15370acc39c596807dab6229dca11fd3a217510258d1b A = 0x95fc77eb3119991a0022168c83eee7178e6c…

TAMUctf 19|Mike's Marvelous Mystery Curves

#TAMUCTF19 https://ctftime.org/task/7746 Mike, the System Administrator, thought it would be a good idea to implement his own Elliptic Curve Diffie Hellman key exchange using unnamed curves to use across the network. We managed to capture …