pub fn common_modulus_attack(
e1: &BigInt,
e2: &BigInt,
c1: &BigInt,
c2: &BigInt,
n: &BigInt,
) -> Option<BigInt>Expand description
Common-modulus attack: recover m when the SAME message is sent to the same modulus N under two
coprime public exponents e₁, e₂ (a key-reuse mistake). Bézout gives a·e₁ + b·e₂ = 1, so
c₁ᵃ · c₂ᵇ = m^{a·e₁ + b·e₂} = m (mod N) — negative exponents handled by inverting the ciphertext.