RSA
公開鍵暗号方式

Haskell で復号する例

1
import Crypto.Number.ModArithmetic
2
3
crackRSA :: Integer -> Integer -> Integer -> Integer -> Integer
4
crackRSA p q e c = expSafe c d n
5
where
6
l = lcm (p-1) (q-1)
7
d = inverseCoprimes e l
8
n = p * q
Copied!
Last modified 2yr ago
Copy link