# Thread: Finding RSA Constants for keygenning...

1. ## Finding RSA Constants for keygenning...

Hi All:

I just unpacked a "famous" packer and analyzed its keygen scheme. It is using RSA. I'm pretty sure of this as it is using constants like A, E, D, N etc. in its keygen code.

My question here is that, if an application packed with this packer is shipped and uses the keygen mechanism provided by this packer for registering the software, then:

(1) What constants must be encoded into the binary so that I can fish it out for a keygen?
(2) What constants must be factored by me to complete the keygen?

BTW, i thought I knew RSA by heart, alas, that thought is short-lived after I reversed this code. I'm off to study RSA again but wanted your opinions on this one.

Signed,
-- Foxthree

2. The constants E and N will be in the target in some form. You must factor N to get it's two prime factors P and Q. The decryption exponent D is calculated from P and Q using D = E^-1 % (P-1)(Q-1).

Hope that helps!
Kythen

3. ## not sure?

If you're not sure it's RSA, can you post what he's calculating?

4. ## Thanks and I will...

Hi Kythen:

Mike: Yes, I will. Let me first complete my analysis.

Signed,
-- FoxThree

#### Posting Permissions

• You may not post new threads
• You may not post replies
• You may not post attachments
• You may not edit your posts
•