RSA-ctf-1

备了个课,列个最基本的rsa知识。

工具

  • windows yafu分解n
  • factordb
  • python gmpy2、pycrypto、rsatool、primefac
  • openssl

基本知识

  • c = pow(m, e, n)
  • m = pow(c, d, n)
  • p q大素数
  • n = p * q
  • phi = (p-1) * (q-1)
  • gcd(e, phi) == 1
  • d = gmpy2.invert(e, phi)
查看公钥文件
openssl rsa -pubin -in pubkey.pem -text -modulus
解密
rsautl -decrypt -inkey private.pem -in flag.enc -out flag

常见攻击

  • e = 3
  • e 大

猜你喜欢

转载自www.cnblogs.com/Sissel/p/9889237.html
今日推荐