2
$\begingroup$

I have a (long) text in two versions, encrypted and plaintext. I think it was encrypted using a substitution cipher method (I'm pretty sure, indeed).

I'm not good in this matter, I know little about it, but I would know if there's a way to know the function/secret used for encrypt that text. I'm ready to study, anyway :)

$\endgroup$
2
  • $\begingroup$ In short: No. Run a frequency analysis if you believe it's a substitution cipher, the relevant wikipedia page should be enough to get you started. If there was an easy way to know the secret (I assume you mean the key), it wouldn't be called a secret. $\endgroup$
    – rath
    Commented Jul 24, 2013 at 19:48
  • $\begingroup$ Your question is basically a duplicate of other questions here, e.g., crypto.stackexchange.com/questions/3826/… $\endgroup$
    – mikeazo
    Commented Jul 25, 2013 at 16:39

2 Answers 2

2
$\begingroup$

If it is a long text and you are sure it is a substitution cipher there are a lot of statistical methods to find the key. Statistical methods rely on the frequency at which alphabets occur in a language. Not just single alphabets but even pairs. For eg in the english alphabet 'E' is the most frequent alphabet followed by 'T' and 'A'. Also some characters such as 'CH' 'QU' 'TH' are found together frequently. All these results can be used to identify the key for the substitution cipher. The longer the text you have the easier it is to identify these patterns. There are quite a few tools online that help you analyse these patterns. Also as mentioned in another answer if you already have parts of the plain text too it is trivial to find the mapping of those characters.

Detailed explanation:
http://people.csail.mit.edu/hasinoff/pubs/hasinoff-quipster-2003.pdf

simple explanation:
http://practicalcryptography.com/cryptanalysis/stochastic-searching/cryptanalysis-simple-substitution-cipher/

$\endgroup$
0
0
$\begingroup$

Typically, your key in a substitution cipher is just a mapping between a letter in plaintext and a letter in the ciphertext. That is, something like "A" => "B", which would mean that every instance of the letter A in the plaintext will be changed to a B in the ciphertext. Going the other way (B=>A) is the decryption.

If you know a single plaintext and ciphertext, you can figure out the mapping by just looking at each letter in the plaintext and seeing what it maps to in the ciphertext. Using this mapping for each character, you can now encrypt and decrypt any other message you want.

$\endgroup$

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