Hacking/암호학

[WriteUp] / [CryptoHack - Elliptic Curves, Curves and Logs]

Cooku222 2025. 6. 17. 22:23

import hashlib

# Alice's public key QA
QA = (815, 3190)

# Bob's private key nB
nB = 1829

# Calculate shared secret: S = nB * QA
shared_secret = scalar_mult(nB, QA)

# Take x-coordinate and compute SHA1 hash
x_coord = shared_secret[0]
sha1_hash = hashlib.sha1(str(x_coord).encode()).hexdigest()

sha1_hash

-> SHA1 로 익스플로잇 구성

-> crypto{80e5212754a824d3a4aed185ace4f9cac0f908bf}