Athena Wiki

Asymmetric Cryptography

cryptointermediate

Index of asymmetric crypto pages - RSA basics, ECC basics, and Diffie-Hellman attacks.

cryptoasymmetricrsaeccdiffie-hellmanindex

Asymmetric Cryptography

Asymmetric crypto challenges usually revolve around math or implementation mistakes rather than brute-forcing keys. RSA, ECC, and Diffie-Hellman are the core families to understand first.

Pages in This Subsection

PageDifficultyFocus
RSA BasicsBeginnerKey generation, encryption, math
ECC BasicsIntermediateCurves, ECDSA, ECDH fundamentals
Diffie-Hellman AttacksIntermediateWeak p, small subgroup, BSGS

Quick RSA Attack Selection

Given nn, ee, cc:

  • e=3e = 3 and m3<nm^3 < n: cube-root / small exponent
  • nn factorable: FactorDB, yafu, Fermat
  • Very large ee, small dd: Wiener (or related)
  • Same mm, same nn, gcd(e1,e2)=1\gcd(e_1,e_2)=1: common modulus
  • Same mm, e=3e = 3, three coprime moduli: Håstad broadcast

Given pp, qq, ee, cc: compute de1(mod(p1)(q1))d \equiv e^{-1} \pmod{(p-1)(q-1)} (or λ(n)\lambda(n)), then mcd(modn)m \equiv c^d \pmod{n}.

Automate: python3 RsaCtfTool.py -n N -e E --uncipher C

Quick ECC Attack Selection

ObservationTechnique
Two signatures with same r?Nonce reuse
ECDSA nonces biased/short?Lattice attack (HNP)
Server accepts arbitrary points?Invalid curve attack
Curve order = prime p?Smart's attack (anomalous)
Small embedding degree?MOV attack

Use SageMath for all ECC math.


Last updated on

On this page