0xy4c1n3

Custom_RSA.py

Aug 10th, 2025
58
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.37 KB | None | 0 0
  1. from Cryptodome.Util.number import getPrime, bytes_to_long
  2.  
  3. m = b"Blitz{REDACTED}"
  4.  
  5. p = getPrime(256)
  6. q = getPrime(256)
  7. x = getPrime(128)
  8. y = getPrime(128)
  9. z = getPrime(128)
  10. e = x*y*z
  11. n = p*q*y
  12. hint1 = p % x
  13. hint2 = p % z
  14.  
  15. print("hint1 = ", hint1)
  16. print("hint2 = ", hint2)
  17. print("n = ", n)
  18. print("e = ", e)
  19. c = pow(bytes_to_long(m), e, n)
  20. print("c = ", c)
  21.  
Advertisement
Add Comment
Please, Sign In to add comment