# Different patterns of different paterns, wildcard

I'm not realy experienced with programming and such but I am wondering if the following could be implemented in, lets say, python

we have the following ciphertext sequence

AO AP AL EE IL OP QR IV OD DD GH DK OL FK PO AD GG PO FK OL DK GH OL OT RI DH SK


and I know part of the plaintext says:

risetovotesir


Than for sure, I know that of the chipher text the following part:

[GH DK OL FK PO AD GG PO FK OL DK GH] = risetovotesir


which means GH = 'r' , DK = i

Now, lets say the ciphertext would be 400 times longer but does not have such pattern in it again, is there a way to "search" for such thing ?

I'm sorry if I explained this too vaguely, but I'd be happy if anyone could tell me how this would be possible.

• What's the context surrounding this? Homework problem? Real-life system test? Exercise out of a book? Some sort of online challenge?
– Reid
Aug 2 '13 at 14:05
• This question appears to be off-topic because it's more suitable for SO, and even so it shows minimal research
– rath
Aug 3 '13 at 4:57
• Probably you messed up copy & paste of those strongs. But check whether those strings are palindroms, I can only suspect that something went wrong. Other than that: Frequency analysis is a common way to break classical ciphers, and it's much more powerful than just looking for patterns.
– tylo
Dec 7 '17 at 15:33

Generally, that is possible.

crypto-analytics

Including solutions that collect statistical information, there are several solutions which are used during cryptographic analytics that can cope with shifting (read: changing) values, frequencies, and pattern detections.

Yet, merely having knowledge of the cyphertext will not be enough most of the time. For example, it's not really helpful when a modern encryption algorithm has been used since such algorithms twist and mix the bits so that it is "near to impossible" to trace or guess how a single bit (or byte) of the message was encrypted.

exploiting partial break

Additionally, you have to count in that - due to the fact your example shows you have part of the plain-text which was used to generate the encrypted message - there are additional hints for analysts that could show how the encrypted message may have been encrypted. This in itself weakens the encrypted text in this specific situation, as it represents a "partial break" which can be build upon.

practical approach

I could go on and practically approach your example to show you step-by-step how I would be able to decode your encrypted message, but while writing this answer I have decided to not do that to prevent going off-topic, because:

analyzing or decyphering a block of data are off-topic here, as the results are rarely useful to anyone else.

I'm sure you understand.