bambi6-service-postit

Simple Note-Taking A/D Service for BambiCTF6 in 2021
git clone https://git.sinitax.com/sinitax/bambi6-service-postit
Log | Files | Refs | README | LICENSE | sfeed.txt

sign.py (311B)


      1from Crypto.PublicKey import RSA
      2
      3def sign(m, key):
      4    return pow(m, key.d, key.n)
      5
      6e = 3
      7key = RSA.generate(1024, e = e)
      8
      9print("Exponent:", e)
     10print("Modulus:", key.n)
     11
     12while True:
     13    msg = input("Challenge: ")
     14    val = int.from_bytes(msg.encode(), byteorder="big")
     15    print("Signature:", sign(val, key))