Score:-2

Decrypting RSA with the key

tj flag

I have a

  • 1024-bits modulus n,
  • the key d which is 1022 bit long,
  • public exponent 65537,
  • two factor p and q,
  • and the ciphertext y 1023 bits which is all in numbers.

How can we perform decryption and work out the plaintext? I have tried CrypTool, tried entering the key d, two factor p and q, but it always give me an error saying

Output block size = 127 is too small must be 128

Maarten Bodewes avatar
in flag
The output size is the (minimum) size of the modulus in bytes. So you could enter 128 and then simply ignore the leftmost bit.
Score:1
de flag

Being that you have all of the necessary ingredients (p, q, n, d, and e) as integers, you can use rsatool to create a .pem file containing the private key in PEM format.

Then, you can use openssl rsautil -decrypt to decrypt the ciphertext, using the private key in PEM format. See https://www.openssl.org/docs/man3.0/man1/openssl-rsautl.html for more info.

Note that openssl operates on raw bytes. You say that you have ciphertext y 1023 bits which is all in numbers, so you may need to convert these number to bytes for openssl to operate on.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.