I have an document encrypted with a symmetric key. The only information I have is that the key is shorter than 64 bits.

Is there any way I can decrypt it? If yes, how?


To decrypt the message, you have to know more than the key; you must also know the encryption scheme, encryption mode, initialization vector, etc. None of this is supposed to be secret; the key and the plaintext message are the only two secrets in most symmetric-key cryptography (and as was stated in the comments, due to protocol requirements and other formatting inherent in most data, the plaintext is not entirely secret).

Those two secrets are enough: according to the Wikipedia docs for AES, the most successful brute-force attack against any symmetric algorithm was against a 64-bit RC5 implementation, which basically required a "white-hat" botnet run by the nonprofit Distributed.net to provide sufficient CPU time to try all of the 18,446,744,073,709,551,616 possible keys in the 64-bit keyspace (that's 18.4 quadrillion keys; putting that in context, the estimated total economic output of the human race in recorded history is only about 2.4 quadrillion US dollars). Using about 2,700 "willing" computers in the botnet, it took five years to crack the cipher. And most of the common symmetric algorithms nowadays (Rijndael/AES, Blowfish/Twofish, Serpent, Triple-DES) use keys at least twice that long, producing a keyspace of approximately 3.4x1038 (340 undecillion) possibilities. The feasibility of a brute-force quickly becomes infeasible; given one more size doubling to a 256-bit key (which is used in some schemes), assuming we could, starting right now, build a Dyson's sphere around our Sun and trap every photon of the plane of the ecliptic (our planet's own orbit) with perfect efficiency, and then build a computer at the electron level with perfect thermal efficiency powered by this Dyson's sphere and set it to try brute-forcing the key, the Sun would go dark before the computer finished trying every key (the Sun would fail at somewhere around 2218 keys).

Even if the cipher they used were vulnerable, most known cryptanalytic attacks against ciphers that aren't completely broken require what's known as a "known-plaintext" or "chosen-plaintext" attack, where you as the attacker can see or even choose the plaintext messages to be fed into the cipher. Most of these attacks still only reduce the complexity of breaking the cipher by a small number of powers of two; for instance, a 64-bit cipher, which would require 2^64 tries to brute-force, might be crackable if you could see, perhaps, 2^44 64-bit blocks being fed into the algorithm using the same key, and see the ciphertext output. Technically, that's an "attack" because it is more efficient than a brute-force. But, it requires you to feed 128 terabytes of data through the algorithm, without knowing the key (which probably means you're feeding it through the one actual machine performing the encryption for someone else, which would eventually arouse suspicion).

In summary, with one ciphertext, no plaintext, and no key, you stand no chance.

Virtually all successful hackers nowadays find the weakest link in the chain (the human, the unsecured computer that human is using, or the flawed implementation of the encryption algorithm on the computer the human is using), and exploit that instead, through keyloggers, social engineering, etc.

So, should this game ever commence for real, I would suggest discretely installing a program on the computer your friend will use to generate the key and encrypt the plaintext, which will transmit the plaintext and/or key to you as it is typed in by your friend. MUCH easier, and faster, than breaking the cipher. Or, if the key is based on an ASCII string, you could kidnap your friend, lock him in your basement, and use some sort of painful but non-damaging interrogation technique until he gives it up.

  • "Or, if the key is based on an ASCII string, you could kidnap your friend, lock him in your basement, and use some sort of painful but non-damaging interrogation technique until he gives it up." +1 just for this.
    – user10211
    Dec 13 '12 at 2:05
  • 1
    Yep, that's called Rubber Hose Cryptography. Hammers also work equally well, but they do leave rather obvious marks.
    – Polynomial
    Dec 13 '12 at 6:59
  • Thinking about kidnaping. It sounds the most fun!
    – N Alex
    Dec 13 '12 at 8:03
  • The plaintext must not be assumed to be secret - at least parts of it are probably known to the attacker (common headers, etc...). There are also real life protocols which allow an attacker to obtain unlimited amounts of plaintext/ciphertext pairs, if your encryption scheme yields the key under those circumstances it has failed.
    – Thomas
    Dec 13 '12 at 12:16
  • 1
    @Polynomial Obligatory wrench Dec 13 '12 at 14:25

Nope. That's pretty much the whole point of encryption. You have no chance of recovering the document without the key, assuming a decent algorithm was used, and a suitable key generation scheme was used.

  • Isn't there any way I can try with a brute force algorithm?
    – N Alex
    Dec 12 '12 at 22:26
  • You can try, but a 64 bit key isn't brute forceable on hardware that costs anything less than several million dollars. There might be some other weaknesses, do you know what algorithm was used and how the key was generated?
    – lynks
    Dec 12 '12 at 22:30
  • I don't have any information of that kind. But I know that the key is shorter than 64 bits, so let's say I could try a brut-force algorithm for keys shorter than 32 bits ( wich as I know is possible on home computers ) and maybe I am lucky. But the problem is that I am new to encryption/decryption and I only know the basics so I was wondering how I can use a brute-force algorithm. Can I find any on the internet or should I write one? (I know c, c++ and java)
    – N Alex
    Dec 12 '12 at 22:37
  • How do you know the key is "shorter than 64 bits" keys are normally a fixed size, are you referring to a pass phrase that is somewhere between 8 and 64 bits long that is turned in to a key? Dec 12 '12 at 22:42
  • 1
    @NAlex Even a 64-bit key is unbreakable by the average desktop computer; the last successful attempt required a botnet leveraging the idle CPU time of about 2700 computers and it took 5 years. See my answer.
    – KeithS
    Dec 13 '12 at 1:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.