# plaintext and its encrypted version known [duplicate]

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 :)

-

## marked as duplicate by woliveirajr, rath, mikeazo♦Jul 25 '13 at 16:38

I can't detect anything that might be regarded to be a question… what are you trying to ask? – e-sushi Jul 11 '13 at 20:48
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. – rath Jul 24 '13 at 19:48
Your question is basically a duplicate of other questions here, e.g., crypto.stackexchange.com/questions/3826/… – mikeazo Jul 25 '13 at 16:39

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

-