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.

I'm looking for a toy encryption system that has a specific property that when decrypting it with a key that is close enough to the key used in the encryption, it will produce some of the original plain text.

The idea is to use it as a game/teaching system where kids can try to break a cyphertext but instead of using cryptanalisys on the cyphertext, I want them to try different keys and then the decrypted text would provide feedback as of how close the key really is, for example:

I encrypt

attack at dawn with key 1234

and let's say the cyphertext is

ABCDEFGHIKLMN

now, if I try to decrypt the cyphertext with key, for example, 1288, it should display some of the plaintext, in order to hint the breaker that the key is somewhat close to the real one

think of it as an encryption system a la Mastermind

A simple substitution cipher kind of does the trick, but I'm wondering if there are other ciphers that behave that way (preferrable with smaller key space)

share|improve this question
3  
One thing that comes to mind is the Vigenere cipher. If you get a few of the key characters right, some of the plaintext characters are revealed. Eventually you can work out the rest of the key by taking guesses at possible plaintext words (though a more powerful and general solution exists). That said the "key distance" isn't like the one in your example (e.g. you'd have keys "CRYPTO" and "CRYPTA" instead of 1234 and 1288) but their Hamming distance should do fine as a metric. –  Thomas Jul 23 '13 at 2:49
1  
Something that might be interesting to you too is the CrypTool portal (www.cryptool.org/en/), which offers e-learning software for teachers and pupils. –  e-sushi Jul 31 '13 at 21:09

1 Answer 1

up vote 5 down vote accepted

You can try NSA's CryptoKids page. It's been around for some years and the ciphers have varying difficulty so you might at least get some ideas.

Alternatively you can use plain XOR encryption with a twist: Encrypt multiple consecutive letters with the same character. For example, if $|m|=n$ then $|k|=n/4$ and do $c_i,...c_{i+4}=k_i \oplus m_i,...,m_{i+4}$. That should give good feedback with every correct guess.

share|improve this answer

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.