* * private key repair
Python script: * *
From the lost private key, we can analyze the numbers represented by each part of the data.
The private key can be recovered by changing various parts of the original script, and the approximate algorithm is:
**LSB Oracle attack
Application: You can choose ciphertext to reveal the lowest bit. **
In an RSA encryption, the plaintext is m, the modulus is n, the encryption index is e, and the ciphertext is C. We can construct c' = ((2e) * c)% n = ((2e) * (me))% n = ((2 * m) e)% n, because twice of m may be greater than n, and the decrypted plaintext is. Because n is odd and 2*m is even, if lsb is 0, it means that (2*m)%n is even, not exceeding n, that is, m.
For more information, please refer to: RSA lease- significant bit Oracle attack and RSA lease significant bit Oracle attack.
Python implementation: