sha1

https://shattered.io/

MD5

72文字, 1バイト違いのASCII文字列の組で衝突するケースが知られている https://twitter.com/realhashbreaker/status/1770161965006008570 Marc Stevens@realhashbreaker Here is a 72-byte alphanum MD5 collision with 1-byte difference for fun: md5("TE…

dhash | IrisCTF 2024

#IrisCTF2024 from Crypto.Util.number import getPrime, isPrime e = 65537 N = 1 while (N - 1) % e == 0: N = getPrime(2048) def xor(a, b): return bytes(x^y for x,y in zip(a,b)) class MySeededHash(): def __init__(self, N, e): self.N = N self.e…

babycha | IrisCTF 2024

#IrisCTF2024 # https://en.wikipedia.org/wiki/Salsa20#ChaCha20_adoption from Crypto.Util.number import long_to_bytes, bytes_to_long import secrets def ROTL(a, b): return (((a) << (b)) | ((a % 2**32) >> (32 - (b)))) % 2**32 def qr(x, a, b, c…

Integral Communication | IrisCTF2024

#IrisCTF2024 from json import JSONDecodeError, loads, dumps from binascii import hexlify, unhexlify from Crypto.Cipher import AES from Crypto.Random import get_random_bytes with open("flag") as f: flag = f.readline() key = get_random_bytes…

Accessible Sesamum Indicum | IrisCTF2024

#IrisCTF2024 #!/usr/bin/env python3 import random MAX_DIGITS = 65536 def vault() -> bool: pin = "".join([random.choice("0123456789abcdef") for _ in range(4)]) digits = ["z", "z", "z", "z"] counter = 0 print("What is the 4-digit PIN?") whil…

ECDSA

#EllipticCurve ベースポイント (位数) 秘密鍵 公開鍵 署名 のx座標とする で が署名 検証 , とする なので、この のx座標が と等しいことを確認する r, sからP=dGを求める は のx座標なので を復元して とすると