Solved

Decryption of a substitution cipher via Java

Posted on 2007-11-15
16
7,060 Views
Last Modified: 2012-06-22
I have a piece of cipher text, and I need to write a Java program to decrypt it, but I'm unsure how to. I know that you need to do a frequency analysis, and then cross reference with a dictionary list, which is fine when I'm doing it on paper through trial and error, but how can I write a program to do the same thing?
(ps i have'nt included the cipher text cause it's about a page long, but i'll post it if you need me to)
0
Comment
Question by:uplinkd
  • 6
  • 5
  • 2
  • +2
16 Comments
 
LVL 17

Expert Comment

by:contactkarthi
ID: 20289802
coupld you just explain with a simple cipher text on how you do it
0
 

Author Comment

by:uplinkd
ID: 20291562
unfortunately that's the problem.
I don't know how it's been encoded other than it's been done via a substitution cipher. I need to write a Java program that will decrypt the substitution cipher text, but without knowing how it was encrypted.
Here's the cipher text:

UFHLFXHTHKHYFIRJRTFHTIXMFERTUSHLFPFMHXF.RTJWRTH,RTUWFFRXWUWJFTUGMO,RUFTUFMFIUWFMFHDYSBQSFUMOHKSTFSBUWFQSDRUFHYGKFYFTUK.UWFBRBUFFTUWJFTUGMOKHEVHQHTFTTSLDFRURTUSHMFDRXRSTSBHFKUWFURJRKY--UFHRKY.UFHRKYRKHJGDUBSGTIFISTUWFHISMHURSTSBUWFLFHGURBGDHYSTXUWFKSMIRIBHJUKSBFPFMOIHOFCRKUFTJF.RURTJGDJHUFKQGMRUOHTIWHMYSTO,UWFYOKUFMOSBYGUGHDJWHMRUO,UWFMSYHTURJRKYSBUWFKSJRHDSMIFM.RURKFKKFTURHDDOHESMKWRQSBUWFRYQFMBFJU,HKRURKHUFTIFMHUUFYQUUSHJJSYQDRKWKSYFUWRTXQSKKRLDFRTUWRKRYQSKKRLDFUWRTXEFATSEHKDRBF.UWFQWRDSKSQWOSBUFHRKTSUYFMFHFKUWFURJRKYRTUWFSMIRTHMOHJJFQUHTJFSBUWFUFMY,BSMRUFCQMFKKFKJSTVSRTUDOERUWFUWRJKHTIMFDRXRSTSGMEWSDFQSRTUSBPRFEHLSGUYHTHTITHUGMF.RURKWO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UHPHUHM.YFHTEWRDF,DFUGKWHPFHKRQSBUFH.UWFHBUFMTSSTXDSERKLMRXWUFTRTXUWFLHYLSSK,UWFBSGTUHRTKHMFLGLLDRTXERUWIFDRXWU,UWFKSGXWRTXSBUWFQRTFKRKWFHMIRTSGMAFUUDF.DFUGKIMFHYSBFPHTFKJFTJF,HTIDRTXFMRTUWFLFHGURBGDBSSDRKWTFKKSBUWRTXK.
0
 
LVL 17

Expert Comment

by:contactkarthi
ID: 20291757
have a look at this link they provide some info about frequent letters and stuff

http://www.cs.utexas.edu/users/scottm/cs303e/Assignments/Assignment_11.htm
0
 
LVL 17

Expert Comment

by:contactkarthi
ID: 20293616
some things i observed are

char - no of occurrences - pcnt

F-1466-12
U-1109-9
H-923-8
S-856-7
T-816-7
R-789-6
K-730-6
M-622-5
W-601-5
D-393-3
I-359-3
G-351-3
J-326-2
B-288-2
Y-282-2
E-205-1
Q-205-1
X-187-1
O-169-1
L-147-1
P-102-0
A-51-0
V-15-0
C-15-0
Z-14-0
N-0-0

my gues is to replace f with a SPACE and similarly

Std frq - ETAONIRSHLDCUPFMWYBGVJKQXZ
Obs frq - FUHSTRKMWDIGJBYEQXOLPAVCZN

have a method like below and pass on the text

private static String replaceString(String input)
      {
            String ciphered = "FUHL";
            String transformed = " IAM";
            for (int i = 0; i < ciphered.length(); i++)
            {
                  input = input.replace(ciphered.charAt(i),transformed.charAt(i));
            }
                  
            return input;
      }
0
 
LVL 17

Expert Comment

by:contactkarthi
ID: 20294718
ignore the previous block of code

use the below one instead



	private static String replaceString(String input)

	{

		String ciphered = "FUHSTRKMWDIGJBYEQXOLPAVCZN";

		String transformed = "ETAONIRSHLDCUPFMWYBGVJKQXZ";

		StringBuffer output = new StringBuffer();

		String c;

		for (int i = 0; i < input.length(); i++)

		{

			c = input.charAt(i)+"";

			if(ciphered.indexOf(c)!=-1)

				output.append(transformed.charAt(ciphered.indexOf(c)));

			else

				output.append(c);

		}

			

		return output.toString();

	}

Open in new window

0
 

Author Comment

by:uplinkd
ID: 20375654
thanks for the comment, and sorry for the late reply, i´m actually away on holiday, and have only just managed to find a computer with internet access!
This is almost what i need, however the frequency count alone will not decrypt the text fully, you actually need to do digram and trigram checks as some of the letters you listed are not correctly decrypted, and then a full dictionary check to find the spaces. I´ve managed to decrypt the text fully by hand, but am still having trouble writing methods to do these digram/trigram checks, as the method i used for decrypting relies a lot on trial and error.
Again, any help would be appreciated.
Cheers (and i´ll check this more regularly now i´ve found a computer lol)
0
 
LVL 17

Expert Comment

by:contactkarthi
ID: 20376352
can you post the code and the algorithm or the steps you are trying to acheive
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 

Author Comment

by:uplinkd
ID: 20387556
basically, from the above encrypted text, i need to carry out a linguistic attack, using frequency analysis and to discover possible decryption via word lists, and also use word lists to add spaces into the text.
I've managed to decrypt it via a trial and error process manually, but i'm finding it difficult to write a program to do this, which is the goal. When i did it manually i wrote bits of code to count the number of instances that the 30 most common digrams and the 12 most common trigrams occured in the text, but even then i had to take the results with a 'pinch of salt'.
Do you reckon i'm going the wrong way about writing the program? Is there a better way of doing it?
I have to use frequency analysis and word lists, but possibly digrams and trigrams only work if decrypting by hand due to the small margins in occurences conflicting with each other.
Unfortunately i don't have any algorithms (that's really the bit i need to discover i think), but the basic steps i need to achieve are: an automated linguistic attack via frequency analysis and word lists, and in particular the use of word lists to to automate the detection of possible word decryption and the insertion of spaces into the text.

Thanks for sticking with me on this :-)
0
 
LVL 15

Expert Comment

by:JimFive
ID: 20509949
I doubt that there is any algorithm that will be 100%, especially without the word breaks.

My first try would be something like:
1.  Perform letter frequency count and substitute in based on language frequency counts.
2.  Start at the beginning of the text.
2a.  Find each word in succession from the word list (I assume provided)
2b.  If a word cannot be found "spell check" the text area to find a word from the list that is close.  Make that substitution.
Go back to 2.
3.  You may want to "declare" a substitution as Final and not let it be changed by future actions, if you do this it would affect your "spell check" function.

--
JimFive
0
 
LVL 15

Expert Comment

by:JimFive
ID: 20639558
I had another thought on this one.

It is fairly easy on modern equipment to brute force your ciphertext and create 26! possible decryptions.

You could then run through word finding/spell checking routine to score each possible solution.  Highest score wins.
--
JimFive
0
 

Accepted Solution

by:
uplinkd earned 0 total points
ID: 20649397
I've actually managed to solve this one with the use of regular expressions and a mixture of lisp and java, I basically used NLP techniques mixed with the java code and a dictionary list for word matching, this gave me a true automatic system (near enough anyway) but thanks for all the comments and ideas.
0
 

Author Comment

by:uplinkd
ID: 20649411
sorry, not lisp, i meant java and prolog
0
 
LVL 84

Expert Comment

by:ozo
ID: 20743657
I'd look at patterns like RTJWRTH = 1234125 and match them  to words in your dictionary
trying different word assignments to different patters to find consistent letter assignments
If you don't know where the word breaks are, you can drag the patterns along the text
You can also look at bigram or trigram frequencies
0
 

Author Comment

by:uplinkd
ID: 20744566
i already said on my previous comment i've done this, don't know how to close the question, but i used digrams and trigrams to get letter frequencies, and then prolog bridged with my java code to use regular expressions to match the words with a word list.
Sorry the question's not closed, but I don't know how to close it, being as i solved it myself.
0
 
LVL 1

Expert Comment

by:Vee_Mod
ID: 20767441
Closed, 500 points refunded.
Vee_Mod
Community Support Moderator
0

Featured Post

Threat Intelligence Starter Resources

Integrating threat intelligence can be challenging, and not all companies are ready. These resources can help you build awareness and prepare for defense.

Join & Write a Comment

Suggested Solutions

This paper addresses the security of Sennheiser DECT Contact Center and Office (CC&O) headsets. It describes the DECT security chain comprised of “Pairing”, “Per Call Authentication” and “Encryption”, which are all part of the standard DECT protocol.
Since pre-biblical times, humans have sought ways to keep secrets, and share the secrets selectively.  This article explores the ways PHP can be used to hide and encrypt information.
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …

706 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now