How to decrypt a PGP message with only the two primes and the public exponent? I'm trying to decrypt a PGP Message that is encrypted with an RSA key, but I only have this information:

Public exponent: 
65537

Prime 1: c447376fcf2a4d4f03840c83f68b23202f081f8561a1f0295703df258a96b8fd6cc8cb307558d60cbd692a45ed2414370349e28badf0f180419fc1df2cd87e99

Prime 2:
d876bd7c4963b8c06f148da504d1f7c7b9b20a719a0d3788eacc7effa7acb9cc200ef3a18a29fb5c733d45e04104ef3e7fc77f3ec847526b0c5d50506a2f471b

It seems when generating a key, the primes are automatically generated so I can't find any tools online that will help me any.

Here's where I'm currently at:


  ~$ gpg -d green.gpg.asc
  gpg: encrypted with RSA key, ID 00000000
  gpg: decryption failed: secret key not available


The end goal is I'd like to create a key that can be imported which would then allow the above command to decrypt the message.

Here's the file I'm trying to decrypt for context:


green.gpg.asc (492k)
Look up the OpenPGP secret key format (some kind of ASN.1 I think?).
Use your favourite bignum implementation to multiply p by q and store this as the modulus n (in the correct format).
To calculate the decryption exponent, you need $d$ such that $ed=1 \pmod{(p-1)(q-1)}$. This can be found with the extended Euclidean algorithm (the wikipedia pages for RSA and the Euclidean algorithm explain the details) - you're probably going to end up implementing this in your favourite bignum library too.
Store $d$ in the secret key file you're building, import it into gnupg and decrypt normally.


Depending on what programming languages you know, there may be shortcuts - instead of building a key file you might be able to build a key data structure directly and use your language's gnupg/libgcrypt wrapper to work with that.