Naked Science Forum

On the Lighter Side => New Theories => Topic started by: old_bob on 27/02/2011 15:45:33

Title: Totally uncrackable substitution cypher
Post by: old_bob on 27/02/2011 15:45:33
I have developed a totally uncrackable substitution cypher. It uses 2 concentric circles of the 26 (randomly ordered) letters of the alphabet. I have challenged conventional code forums,  but they merely say that a fast enough computer would crack it. This is not true. The wheels may or may not rotate after each substitution, a message of 100 characters could be hidden within say 2000 dummy characters, the recipient can read,  from the message sent,  where to find the the first message character, details of spacings to next message character etc etc. The most powerful computer would merely generate from 2000 code message letters every word in the English dictionary. Comments and criticism most welcome.  Brave souls can ask for a coded message.
Title: Totally uncrackable substitution cypher
Post by: Phractality on 27/02/2011 18:42:11
Your invention sounds a bit like Hitler's enigma machine (http://www.google.com/search?q=enigma+machine&rls=com.microsoft:en-us:IE-SearchBox&ie=UTF-8&oe=UTF-8&sourceid=ie7&rlz=1I7GWYE), except it had 8 letter wheels instead of two.

I'm not exactly a cryptographer; I only had one course on the subject so long ago that I don't remember if it was in university of the USAF.

My initial guess is that the key to breaking the code is in knowing how the key for decyphering is generated. The guy receiving the message has to know how to find the 100 characters in the 2000 character text. Presumably, he has memorized a word (maybe 10 characters) which tells him how to do so. If an enemy's computer knows how the key word relates to the text, it only has to try every possible key word until it finds one that produces a non-random output. If there is no secondary level of encryption, the code is cracked. Otherwise, the computer must look for a second layer of encryption. If the key is a long sentence, instead of a 10-letter word, the enemy's job is more difficult.

Cyphers have evolved a lot in the last century. If you're not an expert, you have no idea what it takes to fool those who are.
Title: Totally uncrackable substitution cypher
Post by: imatfaal on 28/02/2011 10:50:23
Bob - it may require a decent chunk of cypher-text and a fairly healthy amount of processing power - but a substitution cypher will always fall eventually. 

For codes to be used they need to be secure (to a desired extent) and easily encrypted/decrypted by the two parties.  If you don't mind adding huge overheads of time to the two parties doing the coding and decoding, vast instruction lists that are prone to being lost or copied, and intricate systems that have little failure redundancy (ie one mis-code/mis-transmission ruins entire message); then you can build substitution cyphers that take arbitrarily long periods and require vast amounts of cypher text to decrypt.  But; what you need to do is to construct cyphers that a fault-tolerant, easily memorised, and simple to translate. 

I personally have cracked playfair and double playfair cyphers (both of which were used by militaries in living memory) with a pen and paper which are very complex substitutions  - I don't have the time to crack anything now, but I am sure others will on encryption sites
Title: Totally uncrackable substitution cypher
Post by: old_bob on 28/02/2011 16:00:57
Thanks for these 2 responses. I repeat, the instructions for decyphering, which are completely differnt each time, are hidden in the coded text. This is where to find the first encoded letter, and how to find subsequent ones. The recipient will be able to decode in a matter of minutes. Say my message is 70 characters long,  and is hidden in 2000 characters. You do not know how long my message is even. You do not know the start letter, or how to find the second letter. So you have to try all 2000 letters as the start letter,  all 1999 as letter 2  etc etc. That is the easy bit! For each parcel of letters, you have to decode every letter, which means trying 26 possibilities. So my 70 character message means you take any letter from 2000, any from 1999,  any from 1998,  this is 2000x1999x1998x1997,,,,,,,,x1930  parcels of text.  For each of these you try every possible letter substitution. So you take this huge number and multiply it by 26 to the power 70.

Please explain to me how you can possibly find my message. You will find "the cat sat on the mat" ,  "the dog chased the rabbit",  "old speckled hen is nice beer" and every sentence that every member of this forum could create.

I have tried to persuade cypher forums to take it on,  but they won't, they just say a big enough computer could crack it.  I want someone to say how they could find my short message rather than billions of other apparent messages. Remember, the rules for finding the start and subsequent messages change every time. I could transmit my message one word at a time, hidden in 2000 characters.  This would clearly be impossible to crack.......... 
Title: Totally uncrackable substitution cypher
Post by: imatfaal on 28/02/2011 17:17:06
a plain text of 5 letters in 2000 - of course no one can find that! You could just write the word in plain text and it would be hard to find.  But there is also practically no utility in it.  Do you realise how time consuming putting in 1995 random letter would be; cos if they aint random the code will fail upon repeated use.  Now if you increase your plain text to 1333 characters (ie your last post length) then the very sophisticated algorithms that can now be employed would have a fair chance.
Title: Totally uncrackable substitution cypher
Post by: Bored chemist on 28/02/2011 19:12:03
At one extreme, Old bob is right.
With a short enough message, buried in enough nonsense, it's impossible to crack.
However with a long sequence of messages (which is what would happen with a useful code) you would be able to crack it eventually, unless it's mathematically inequivalent to a "one time pad". If it's equivalent to OTP then it's nothing new and it just raises the same problem of key distribution.

You don't even need a lot of rubbish to obscure a message.

Imagine that I need to send a message to my friend. The message is very simple ; it's a reply to the question "do you want another beer?"
However, I know that someone else is listening and (for some strange reason) I don't want them to understand the reply.
No problem ; I can tell my friend that, when he asks I will either say "yes no" or I will say "no yes" and he is to wait for the second word.
Since the evil listener doesn't know whether to listen to the first word, or the second, he is unable to understand the message, but my friend does.
 The eavesdropper can hear the message, but it provides absolutely no information to him. Without the message, it would be a 50:50 guess as to whether I wanted another beer. With the information, it's now a 50:50 guess as to which code we are using.

The security of this system is perfect; once.

If we use the same code repeatedly then, after a short while, Mr Evil will work out what the code is.
I suspect your system is similar- albeit that you need a lot more data to crack it.
Title: Totally uncrackable substitution cypher
Post by: yor_on on 06/03/2011 04:09:25
I have a uncrackable too. Using existing books, and numbers referring to the appropriate texts :)that I've already arranged with my counterpart, and changing the books constantly (prearranged in my last mess at a time, without needing to state which one) for example. Here's one mess 111 32 5 4 77 that I will send 111325477 and also fill in with some unnecessary numbers (prearranged) :)

How about it?
It's a old one, but I think it still works.
Title: Totally uncrackable substitution cypher
Post by: old_bob on 16/03/2011 15:15:11
Imatfaal said  Do you realise how time consuming putting in 1995 random letter would be;

Actually I generate the random letters with excel (using my own random number seed) obeying letter distribution frequencies. Then I alter a few of them for the hell of it. Then I insert my encoded letters and decoding instructions. I change these random letters every message. I say again, a message of 75 characters (and you do not know it is 75 letters)hidden in a block of 2000 letters. YOU do not know start point, or how many letters to ignore before next message letter. Then there is the little matter of decoding....
Title: Totally uncrackable substitution cypher
Post by: old_bob on 16/03/2011 15:18:15
and for total clarity, the message always contains hidden characters that tell my friend where the encoded letters are hidden,  and it is totally different each time - I never need to speak to my friend about decoding....
Title: Totally uncrackable substitution cypher
Post by: Bored chemist on 16/03/2011 19:07:43
"the message always contains hidden characters that tell my friend where the encoded letters are hidden,"
Thanks for that.
Any information added to the message will make it easier to  decode.
Title: Totally uncrackable substitution cypher
Post by: CliffordK on 20/03/2011 20:33:45
I like the idea of adding gibberish.

But...
Perhaps another approach is to use the "extra" characters to encode a false message...  and make it somewhat easier to decode.

For example...
Send the message
"Attack place X at 0800".
But...
With an additional level of encryption.
The real message is
"Attack place Y at 0600".

You would expect the hacker to stop once they crack the first message.
However, the intended receiver would have the additional instructions to decode the real message.
Title: Totally uncrackable substitution cypher
Post by: imatfaal on 21/03/2011 12:59:50
If you can generate gibberish you are doing better than any mathematical system - you can only generate pseudo-gibberish.  Any additional information that both parties require - adds complexity but not much more; it is very easy to work out a cipher that is uncrackable if both parties have huge instruction manuals.  In reality, when working in a pressure situation or conversely in a familiar situation - complex instruction sets tend to create problems for team and opportunities for crackers
Title: Totally uncrackable substitution cypher
Post by: CliffordK on 21/03/2011 20:17:13
Good Point.

If you send a computerized decryption algorithm to the recipient....
Then all one needs to do is steal the decryption algorithm.

Somewhat like the Allied Forces did in WWII, stealing several Enigma Machines.

Of course, each decryption algorithm could be customized for the recipient.  But, the loss of one decryptor would still seriously compromise the code.
Title: Totally uncrackable substitution cypher
Post by: Bored chemist on 21/03/2011 22:27:42
They didn't need to steal the enigma machines- they just needed to look at the patents. It was only later when the the design changed that the acquisition of the machine helped.
Also, they had cracked the system by then because other information was made available to them by accident and overconfidence because the Germans "knew" the system was "uncrackable".
Other data was presented in the form of people repeatedly sending the same data or always using the same "key" to set the machine in the first place, it seems the 6 letters HITLER were rather often used.

Also the operators eavesdropping on the code senders came to recognise the individuals sending it. The senders had different "styles" so, if one day they knew that some particular sender had used JANE (or whatever his girlfriend's name was) as the key they were likely to try that key if they heard that sender again.

OTP remains uncrackable and any long message hidden in enough gibberish is likely to be hard to crack, even if it's only pseudorandom dross.
Title: Totally uncrackable substitution cypher
Post by: old_bob on 22/03/2011 18:42:51
ok,  I will give you the coded message that was hidden in 2000 characters. That has saved you much work and time. explain how you can possibly decode it, or better,  decode it.

jevsioimtyfsgslnziftsiumbbdckgkkexsare

the j can be any letter a to z including j
the e can be any letter a to z including e

and so on...

But in reality you would have had to find the message of unknown length first. It just cannot be cracked.
I can send hundreds more coded messages to my recipient. He will decode each of them in less than 5 minutes. I never need to tell him, other than in the message, how to decode the message. The start point of the message is usually different. Gaps between "encoded characters" always vary (eg the gaps could be 3  then 11,  then 4, then 31 then 3 again....)but very different next message, and vary in different ways. You can intercept my messages but all you see is a block of 2000 or 20000 characters, most of which are random, but in a deliberately non random way. I start with Excel random numbers, convert to letters approximating to letter frequencies, and change a lot of them in a way I cannot reveal.
Title: Totally uncrackable substitution cypher
Post by: Bored chemist on 22/03/2011 22:23:03
"explain how you can possibly decode it"
http://en.wikipedia.org/wiki/Rubber-hose_cryptanalysis

Now, are you sure about "or better,  decode it."?
Title: Totally uncrackable substitution cypher
Post by: JMLCarter on 28/03/2011 21:47:16
What is the secret your friend knows in order to identify the "hidden key" in the message so that he can start decoding?
That is the true key, and cracking the code is the job of finding it.
Title: Totally uncrackable substitution cypher
Post by: old_bob on 11/04/2011 16:32:26
my friend knows which letter of the 2000  letters to place adjacent to a certain letter on my substitution wheel, at another location in the 2000 letter block is info about the spacings between message letters, these remain constant for every message,  but you still have to try all 2000 letters as the "info" letter, only my friend knows how to apply the information. since each 26 letter circle is random, even if I told you the LETTER E  is to be placed above a certail letter on the other wheel,  you are no closer to solution....
Title: Totally uncrackable substitution cypher
Post by: old_bob on 11/04/2011 16:37:00
Luckily you nice people on here would never beat me up with a rubber hose - buying me a few pints down the pub is your best bet,  but you do not know where I live, and which pub I frequent,  so just go into EVERY pub and buy EVERYBODY in there a few drinks....the probability of success is trillions of times higher than decoding with a big fast computer....
Title: Totally uncrackable substitution cypher
Post by: JMLCarter on 11/04/2011 19:52:32
It's not hard to make a totally uncrackable code. The use of the substitution wheel makes what you have done more analogous to a codebook than a cypher.
Codebooks are completely uncrackable if they are only ever used once, see "one time pad".

Many messages might be need to be intercepted for a computer to have enough material to divine your two reference letters and the content of the substitution wheel, but the long messages would be more useful than the short ones. The more messages, the more likely the correct meaningful English sentence is derived.

If it's a good code, this may be impossible practically, but never-the-less, it remains a theoretical possibility.

One signifcant problem with encryption and codes is how to get the key / codebook or shared secret to the trusted individual on the other end of the communication link. A key distribution infrastructure is needed - or for a more modern solution take a look at diffie-helman, which is the basis for ipsec.

Another significant problem is that the code quickly becomes the strongest link in the chain of security; so, if you are protecting valuable enough secrets, the malicious intelligence agency blackmails one of your operatives instead.