-1

I have an encoded file and a public.pem file. Is it possible to decode the file using the public.pem file or do I have to start looking at private keys?

I tried https://github.com/Ganapati/RsaCtfTool with no luck. The public key (pem) is as below

-----BEGIN PUBLIC KEY-----
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAjHDiqVkO1umD2/Tm20Wt
LpyBXGoIk4Pczeqjwz7/kwYLnQI7VlAzgjC9jD1dX80Z+kLOr5wHIDdfNK55nC/q
ux/g7xVt0YKMl5yzObHUgX0YUi//8k2a5YfidxWoX77B7GfuBKx0efEsM7p+7cYT
z7OVKFdRIvKATMGsYlWOPT9b97OtTQjtZKyhAtL1PdbfqKCCxRzqvj1OthtHbB+b
4AJG4MI2IHJQ0LHyj83md3iIMQSMZxwe8JsWQs3jW7W1xRDWjDsKn1799kPTTgG3
GtVrO6J38HN5t5dk8ZNa7duh9phRyEBQbo2lH/tYqUBKeJ3v/dA0BhQVMdZe5m8R
uQIDAQAB
-----END PUBLIC KEY-----
pee2pee
  • 117
  • 8

2 Answers2

3

Adding on to the above, the modulus and public exponent can be extracted from the public.pem. The public exponent e is 10001.

It turns out that this is a constructed modulus which is very weak and was not generated using recommended security guidelines.

The 2048 bit, 617 decimal digit modulus N=pq can be factored immediately because it is a square. That's right p=q and N = p^2.

phi(N) = p(p-1)

The method to find d the private exponent when e, p and q are known has been shown many times on this forum. Then the file can be decrypted.

2

Is it possible to decode the file using the public.pem file

No.

or do I have to start looking at private keys?

Yes.

RSA is an asymmetric encryption algorithm. That means that its keys come in pairs, containing a public key and a private key, and that data encrypted with the public key can only be decrypted with the private key.

Ilmari Karonen
  • 46,700
  • 5
  • 112
  • 189