There is an RSA implementation which I need to attack to get the encrypted messages. Some of the values are known.
Plain text value for input.
So if I enter a message, say it "A", the plain text is 4263178
if I enter a message, say it "B", the plain text is 4328714
N value and public exponent. I need to get the private exponent to decrypt the messages. I tried many things to get the private exponent but seems like I cannot get that.
Well, what I tried is that, I tried to figure out how the plain text value is calculated. When the input message is a single character, the following equation works.
plain text = 3338 + Ascii Code * 65536 ( I compared the plain texts to get this)
So for "A" plain text = 3338 + 65 * 65536
but when the number of characters more than 1, that doesnt work and I cannot find how it is calculated when there are 2 characters.
I read this article to understand how plain text is calculated. The article is clear but it does not fit the way my plain text is calculated.
Then, I wrote a small java program to attack the encryption by comparing the input plain text (because it is known) and the plain text equation where P = C^PK mode N (PK is the private exponent which I am trying to find). I put this formula in a loop and executed that from 0 - 10,000, but it didn't find the private exponent (my small java program works because I tested it with a known encryption scheme and extracted the private exponent).
Now, I cannot figure out a way about how to approach an attack for this encryption.
So again, the known values are
- Plain text value for any input
- N (modulus)
- Public exponent
- Cipher Text
- Encrypted message
Now, how to get private exponent..?
any suggestions please?