I have a .txt.enc file. It is an output of openssl enc. I need to open it. When I try to open it in Emacs, the first some characters(also known characters) are : 'Salted__C' . how can I understand that which decryption method such as '-aes-256-cbc' or '-cast5-cbc' I should use to open it?
What Adnan says about ciphertext indistinguishability is correct, this can be a hard problem, the only clue you have is "
Assuming the file was encrypted with a password (or key/IV pair) that you have, you will have to try every every method:
(There are some duplicate ciphers due to name aliases, e.g .
Now you'll see the next problem, with many algorithms you can decrypt ciphertext with a bad password and not know if the algorithm and/or password were correct.
There are a number of methods to determine if a password was correct and a decryption was successful (e.g. via checksum, integrity (e.g. with HMAC), padding (e.g. with PKCS#5) or other expected structure, or known "left over" state), though sometimes not being able to tell is in fact a feature.