0
$\begingroup$

im having a problem while solving a RSA problem, so i have python script to create a RSA key and cipher, from that i have n, invp, and invq. so my question is possible to decrypt the message only with n, invp, and invq. Here's the code

from Crypto.PublicKey import RSA
from Crypto.Cipher import PKCS1_OAEP

message = bytes('seccreeetttt', encoding='utf-8')
key = RSA.generate(2048)
cipher = PKCS1_OAEP.new(key)
ct = cipher.encrypt(message)
print(key.n)
print(key.invp)
print(key.invq)
print(ct)

and the output

22952552825037553208589096165242660277079814094183276873079909851943463036945153387557183758316294729416133670713705132869462243363747798232032671654074637605107951710393834048681471811567952254060023385215009569538631071930055199744636956039654006517651206255269080364046092411668611132590129579259270927581325624773795643855705850358939883724406306418820717111487692856281516614051094114705929121423407101332088124042150889509501597216327824776884748412486585968553561814684440822170007044907888709866179060881286334778923820553288711054581803265605135021930549004917176478076658295939298440410800453610420784514457
163882732681011974117964095241512724964174035813367591706325214234200287217436607411780964390312708482743593138034867229898010005380965207066160414127619082907877801827298833620891890898399317834648975726792134305597419952280242983199611380599923775647406646313572445197360361496233777371466832268309751027400
8199057223758240152335562983205355098470471408203502855692459583092981421137253285881215078560856677573652286387349952842606605032529999529740761548782764321969094758106790305148212636865417002195134316934877626601994849828699145449072737101068731796017218203705313864472498801699218279579743987247107819566
b'\x7f\xa2\t\xf1\xe0B\xa8OK\x9a\xde\xc7o\x9c4]\xealz\x98\x14\x99xN\xdc9\xd4\xaa\x90\xdc2:\x1d\xdb:i\xa7\x82\xe0\xd5S\xf8\x10\x93\x1dh\xc1:\xee5\xc6\xf641,\xa0B\x8e?N\xbd_\xcb\x9f\x0e\xf1>\xda\xe8^{\x99d.,\xcf\xca\xd1zHGt\xcd\xcf\x06"\x7f\xf6z\xb8\xa8\x14\xa8\xab\xec8\xe3\x81\xa5\xc3Bt\x8a`\xee\x9b\xb7\xf3}~\x88\x89y!\xc2\xe3\xeb\xda\xdc;\xbe\xea\x1ez\x03L\xf9\xf6v\x03\xe1[\x9eL\x9e\xd7\x0e~7t"q\x18\xa6Q\x15\xc8>[:\xc0>\xd7\xcdpng\xf38\r*\x1e\xfc\x0fc\xc1YQ\xf6\xb9B\x8f\x98\x04\xc0\xc3Y\x10\xb93[\x15\xb7\xc1CT\x12\xbb\xcc0\xcb\xb5\xae\xad\xe9\x04\x00TC{\t0\xfc\xe8\x89\x8c\xf2_q\t\xda\xcd \xb3\xce\x84\x1eK\\\xae\x98\x0e_g\xd8\xf6\xcfB\x19\xa8\xe0\xdfos\x96\x8a\xede\xc7\x0f\x91\xbe/\xbav~\x8a)\xcc\xe1\x1b\xb7\xf5\xbe"\xe8'
```
$\endgroup$
2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Browse other questions tagged or ask your own question.