Please help on Substitution cipher
I have been working on a substitution cipher program for about five hours now and cant solve it.
All the prof gave us was a string of numbers and he said we would know what to do once we figured it out. I have no clue. We downloaded Netbeans for the class so I fugire I might neet to use that to solve it but have no Idea.
Could someone please help I am completely new to all of this.
The cipher:
46 46 46 98 06 38 98 42 28 40 98 10 08 42 99 ~ 14 02 36 24 18 06 22 99 34 34 98 16 40 26 24
Substitution ciphers are usually broken by knowing the frequency that letters occur. Eg. if you were to scan a page of text, you might find that the frequency of
"e" = 200, "a" = 160, "t" = 75, "s" = 75
So, you produce a list of these, sorted by their frequency of occurance.
You typically produce this list by reading in a large amount of text, ideally similar to the encrypted version.
Once you have that frequency table, you can work out the frequencies of the encrypted characters, and try matching them up.
regards,
Owen
But the cipher given does not contain letters, it is numeric.
> But the cipher given does not contain letters, it is> numeric.Then use the numbers... They look a little strange, but they could be char codes.
it doesn't matter.... letters are numbers in computers, ie. A = 65 in Ascii.
So, when you build up your frequency tables, you can store the Unicode/Ascii code for the letter, as opposed the actual character.
I'd probably implement the frequency table as a two dimensional array.
With the character code in the first column, and the frequency in the second.
Build up your table, then sort the entire 2 d array by the frequency column.
regards,
Owen
im sorry im still very confused, how can I use the numbers?
> im sorry im still very confused, how can I use the> numbers?I meant, check the frequency of the numbers and match them to your frequency patterns. Each number could stand for a letter, like in an ASCII table.
But where do I get what numbers equal what letters like "A=64" And i dont understand how to make the table.Also the string of numbers starts with three of the same number consecutavly, who will it make sense?
> But where do I get what numbers equal what letters
> like "A=64"
I think it's your job to find that out - that'll be the end result of your work.
>And i dont understand how to make the
> table.
Have a text. Count the occurence of each letter. Divide the occurence of each letter by the overall number of letters. You get the frequency.
Then do the same for your numbers. See which number frequency matches which letter frequency.
I think that's the idea.
> Also the string of numbers starts with three of the
> same number consecutavly, who will it make sense?
Might be three spaces, or just something to confuse you.
You will have one frequency table that you have "trained", from a normal unencrypted page(s) of text.
You will build another frequency table, for the encrypted string.
You sort both, by the frequency counts..... then directly match up the two arrays together. So that the element in encryptedFreqTable[ i ] matches the element in plainTextFreqTable[ i ]
I understand that I need to make a table but i dont see how im going to get letters from it.
Each frequency table element, should hold not only the frequency count, but also the character that it counted.
I mentioned that before here...
I'd probably implement the frequency table as a two dimensional array.
With the character code in the first column, and the frequency in the second.
Build up your table, then sort the entire 2 d array by the frequency column.
> I understand that I need to make a table but i dont> see how im going to get letters from it.If you only store the frequencies, it's not a table, but just a list. :)
ok I got the frequency, and for example 98 sows up four times so I have a four, and then a three for the 46's but then i have several 2's and allot of 1's which doesnt make sense.
True.
You cannot decrypt a random substituion cipher, especially short ones.
The only thing you can do is to programatically guess the letters.
I remember having to do this exercise ( about 13 years ago ! ).
Any encrypted letters which have the same frequency count, cannot be resolved effectively.
The whole point of this exercise is to GUESS, not to fully decrypt the string.
Considering your level of experience, you are not expected to do any more.
regards,
Owen
hmmmm, that makes even less sense. How would I start this guessing procedure?Also are we sure there is not something in Java Netbeans that decripts?
NetBeans is just an IDE, it doesn't add any extra functionality to java.If you're this confused, then ask some of your fellow students, or God forbid,ask your lecturer directly for hints.
I have to email him by noon today with the answer. class just started and I was too shy this week to talk to anyone much less exchange numbers. I guess im screwed.
> hmmmm, that makes even less sense. How would I start> this guessing procedure?Maybe by simply printing out the letter frequency tables and doing a pencil-and-paper decryption attempt.
I used the homophonic decipher tool and got this: eeeegperxrefuroezsengmovveerle:(
:) What happens - just as a guess - if you leave the first three letters away? Another quesion: is the tool you used calibrated on the same language the cypher string is written in?
yes because the site is in english. http://www.simonsingh.net/The_Black_Chamber/homophoniccipher.htmI cant beleive I cant figure this out, I have never put in 6 hours of research into somthing that will yield no results.
That just shows your inexperience. I've put in days of research into topics only to come to the conclusion that something wasn't possible.You've been pretty much handed your entire algorithm. If you can't implement it you might consider another career.
Ok well i found out it was not actually do till 11:59 pm so I have allot more time.
Well you have a clue. it starts with three of the same letter.What english words begin with three of the same letters. None I can think of.
I am assuming that the first three numbers indicate a frequency and not an actual order of letters. I think that there is decipher program that will do it but i have not found it. I also thought that this had something to do with Java, but supposedly it doesnt. I have been working on it for three hours since this morning and dont have anything yet but i thik i might be getting close.
> I used the homophonic decipher tool and got this:> eeeegperxrefuroezsengmovveerle> This does not resemble what you claim to be working with. Do you really think it is wise to translate e as like 5 different numbers? Do you have any code written yet?
uhm i tried writting several but none yielded results. I have been doing allot of research and am currently working on a Squere code table.
I haven't seen one line of code from you yet.