1

I am wondering if there exist a tools which can return the value of the one of the private key if the following are known: 1) Encryption Algorithm 2) Public key 3) Plain text 4) Cipher text

Or may be there a special methodology how to obtain that.

I am not sure how complicated and time consuming is to do that programatically so any help will be usefull.

Thank you

Alex
  • 412
  • 1
  • 8
  • 14

3 Answers3

5

If: you know the public key, algorithm, plain text and cipher text;

And: you can recompute the private key by using just the aggregate power of all computers on Earth;

Then: the algorithm is pure junk or the key is awfully undersized; either way, stop using it and switch to proper cryptography.

Corollary: what you ask for does not exist for the cryptographic algorithms which are used in practice, e.g. RSA.

Thomas Pornin
  • 320,799
  • 57
  • 780
  • 949
3

To recover the private key for an encryption algorithm is an attack on the algorithm, since knowing the private key allows one to decrypt anything that has been encrypted with the key, which defeats the confidentiality property of encryption.

The algorithm is always assumed to be known as it is often public knowledge. For public-key algorithms, the public key is considered public knowledge too, as its name indicates. To recover the private key knowing some plaintext and its corresponding ciphertext, or even many (plaintext, ciphertext) pairs, is called a known-plaintext attack. The subcase where the attacker can submit many plaintexts for encryption and obtain the corresponding ciphertexts is called a chosen-plaintext attack.

If an encryption algorithm is vulnerable to such an attack, it is considered deeply broken. Any encryption algorithm that is considered safe for use must have no attack that is significantly better than brute force. Brute force is of course possible in theory, but not in practice: for any reasonable algorithm, it would take longer than the present age of the universe using all the computing power now available to mankind to find the key by brute force.

Therefore, assuming the algorithm is not completely broken, no practical tool can exist to find the private key given the algorithm, the public key, and any number of (plaintext, ciphertext) pairs.

Gilles 'SO- stop being evil'
  • 50,912
  • 13
  • 120
  • 179
2

Aside from brute force, I know of three viable1 methods:

  1. chocolate bar cryptanalysis
  2. rubber hose cryptanalysis (a.k.a. wrench cryptanalysis)
  3. good old-fashioned theft, optionally with a 21st century twist

(Being slightly more serious, public key or asymmetric key cryptography is designed with almost exactly these criteria in mind, there are no known programmatic methods ;-)


1 most of which are probably illegal somewhere
mr.spuratic
  • 7,937
  • 25
  • 37