Ingin menangid
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

22 lines
580 B

  1. from Crypto.Util.number import inverse
  2. from fractions import *
  3. e = 43
  4. n = 2531257
  5. c = "906851 991083 1780304 2380434 438490 356019 921472 822283 817856 556932 2102538 2501908 2211404 991083 1562919 38268"
  6. c = c.split(" ")
  7. c = map(int, c)
  8. p = 509
  9. q = 4973
  10. phi = (p - 1) * (q - 1)
  11. d = inverse(e, phi)
  12. m = []
  13. for i in c:
  14. m.append(pow(i, d, n))
  15. print m
  16. plain = [103, 105, 103, 101, 109, 123, 83, 97, 118, 97, 103, 101, 95, 83, 105, 120, 95, 70, 108, 121, 105, 110, 103, 95, 84, 105, 103, 101, 114, 115, 125]
  17. flag = ""
  18. for i in plain:
  19. flag += chr(i)
  20. print "Decoded flag : ", flag