Take the 2-minute tour ×
Cryptography Stack Exchange is a question and answer site for software developers, mathematicians and others interested in cryptography. It's 100% free, no registration required.

Is it possible to tell which encryption algorithm was used, assuming I have a key and a encrypted text?

To not complicate the situation let assume we are speaking about symmetric algorithms only.

Are there any common methods to discover encryption method?

share|improve this question
1  
possible duplicate of Is it possible to derive the encryption method from encrypted text? –  e-sushi Dec 20 '13 at 12:23
add comment

1 Answer 1

up vote 0 down vote accepted

The normal method is to reverse-engineer whatever software produces or consumes the ciphertext. The underlying idea is that in a practical attack situation, the attacker has some known interest in breaking the system; there is context. The context usually indicates what kind of algorithm is in use.

In some cases where the code to reverse-engineer is not immediately apparent, other clues can be gathered. For instance, a smart card which can encrypt data at relatively high speed must necessarily use some dedicated hardware, so data sheets from the smart card vendor can point to what algorithms are possible.

Many communication protocols strive for algorithm agility and therefore include an explicit header about what algorithm is used. For instance, in SSL/TLS, the set of algorithms which will be used by client and server is negotiated in plain view, so what encryption algorithm is used is perfectly known to everybody, including any attacker.


Now, if you envision a formal, unrealistic setup where you are just given a black box which encrypts data with an algorithm and a key that you do not know, then guessing the algorithm details would amount as a break, in an academic point of view. Good encryption is supposed to be indistinguishable from randomness, which implies, in particular, that any secure encryption algorithm is supposed to be indistinguishable from every other secure algorithm.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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