Results 1 to 7 of 7
  1. #1
    laxbro is offline Member
    Join Date
    Jan 2013
    Posts
    7
    Rep Power
    0

    Default Transposition Cipher Decryption

    I have to create a basic program that will analyze the encrypted message and find the key to decrypt it. I have no clue where to start on this. HELP
    These are the classes in the project. I'm assuming the EisenhowerFarewellAddress is the original message because it has the same number of characters as the encrypted message. How should I start attacking this?
    Java Code:
    public class EisenhowerFarewellAddress {
    	public static void main(String[] args) {
    		String sentence="Good evening, my fellow Americans. First, I should like to express my gratitude to the radio and television networks for the opportunities they have given me over the years to bring reports and messages to our nation. My special thanks go to them for the opportunity of addressing you this evening. Three days from now, after half century in the service of our country, I shall lay down the responsibilities of office as, in traditional and solemn ceremony, the authority of the Presidency is vested in my successor. This evening, I come to you with a message of leave-taking and farewell, and to share a few final thoughts with you, my countrymen. Like every other -- Like every other citizen, I wish the new President, and all who will labor with him, Godspeed. I pray that the coming years will be blessed with peace and prosperity for all. Our people expect their President and the Congress to find essential agreement on issues of great moment, the wise resolution of which will better shape the future of the nation. My own relations with the Congress, which began on a remote and tenuous basis when, long ago, a member of the Senate appointed me to West Point, have since ranged to the intimate during the war and immediate post-war period, and finally to the mutually interdependent during these past eight years. In this final relationship, the Congress and the Administration have, on most vital issues, cooperated well, to serve the nation good, rather than mere partisanship, and so have assured that the business of the nation should go forward. So, my official relationship with the Congress ends in a feeling -- on my part -- of gratitude that we have been able to do so much together. We now stand ten years past the midpoint of a century that has witnessed four major wars among great nations. Three of these involved our own country. Despite these holocausts, America is today the strongest, the most influential, and most productive nation in the world. Understandably proud of this pre-eminence, we yet realize that America's leadership and prestige depend, not merely upon our unmatched material progress, riches, and military strength, but on how we use our power in the interests of world peace and human betterment. Throughout America's adventure in free government, our basic purposes have been to keep the peace, to foster progress in human achievement, and to enhance liberty, dignity, and integrity among peoples and among nations. To strive for less would be unworthy of a free and religious people. Any failure traceable to arrogance, or our lack of comprehension, or readiness to sacrifice would inflict upon us grievous hurt, both at home and abroad. Progress toward these noble goals is persistently threatened by the conflict now engulfing the world. It commands our whole attention, absorbs our very beings. We face a hostile ideology global in scope, atheistic in character, ruthless in purpose, and insiduous [insidious] in method. Unhappily, the danger it poses promises to be of indefinite duration. To meet it successfully, there is called for, not so much the emotional and transitory sacrifices of crisis, but rather those which enable us to carry forward steadily, surely, and without complaint the burdens of a prolonged and complex struggle with liberty the stake. Only thus shall we remain, despite every provocation, on our charted course toward permanent peace and human betterment. Crises there will continue to be. In meeting them, whether foreign or domestic, great or small, there is a recurring temptation to feel that some spectacular and costly action could become the miraculous solution to all current difficulties. A huge increase in newer elements of our defenses; development of unrealistic programs to cure every ill in agriculture; a dramatic expansion in basic and applied research -- these and many other possibilities, each possibly promising in itself, may be suggested as the only way to the road we wish to travel. But each proposal must be weighed in the light of a broader consideration: the need to maintain balance in and among national programs, balance between the private and the public economy, balance between the cost and hoped for advantages, balance between the clearly necessary and the comfortably desirable, balance between our essential requirements as a nation and the duties imposed by the nation upon the individual, balance between actions of the moment and the national welfare of the future. Good judgment seeks balance and progress. Lack of it eventually finds imbalance and frustration. The record of many decades stands as proof that our people and their Government have, in the main, understood these truths and have responded to them well, in the face of threat and stress. But threats, new in kind or degree, constantly arise. Of these, I mention two only. A vital element in keeping the peace is our military establishment. Our arms must be mighty, ready for instant action, so that no potential aggressor may be tempted to risk his own destruction. Our military organization today bears little relation to that known of any of my predecessors in peacetime, or, indeed, by the fighting men of World War II or Korea. Until the latest of our world conflicts, the United States had no armaments industry. American makers of plowshares could, with time and as required, make swords as well. But we can no longer risk emergency improvisation of national defense. We have been compelled to create a permanent armaments industry of vast proportions. Added to this, three and a half million men and women are directly engaged in the defense establishment. We annually spend on military security alone more than the net income of all United States cooperations -- corporations. Now this conjunction of an immense military establishment and a large arms industry is new in the American experience. The total influence -- economic, political, even spiritual -- is felt in every city, every Statehouse, every office of the Federal government. We recognize the imperative need for this development. Yet, we must not fail to comprehend its grave implications. Our toil, resources, and livelihood are all involved. So is the very structure of our society. In the councils of government, we must guard against the acquisition of unwarranted influence, whether sought or unsought, by the military-industrial complex. The potential for the disastrous rise of misplaced power exists and will persist. We must never let the weight of this combination endanger our liberties or democratic processes. We should take nothing for granted. Only an alert and knowledgeable citizenry can compel the proper meshing of the huge industrial and military machinery of defense with our peaceful methods and goals, so that security and liberty may prosper together. Akin to, and largely responsible for the sweeping changes in our industrial-military posture, has been the technological revolution during recent decades. In this revolution, research has become central; it also becomes more formalized, complex, and costly. A steadily increasing share is conducted for, by, or at the direction of, the Federal government. Today, the solitary inventor, tinkering in his shop, has been overshadowed by task forces of scientists in laboratories and testing fields. In the same fashion, the free university, historically the fountainhead of free ideas and scientific discovery, has experienced a revolution in the conduct of research. Partly because of the huge costs involved, a government contract becomes virtually a substitute for intellectual curiosity. For every old blackboard there are now hundreds of new electronic computers. The prospect of domination of the nation's scholars by Federal employment, project allocations, and the power of money is ever present -- and is gravely to be regarded. Yet, in holding scientific research and discovery in respect, as we should, we must also be alert to the equal and opposite danger that public policy could itself become the captive of a scientific-technological elite. It is the task of statesmanship to mold, to balance, and to integrate these and other forces, new and old, within the principles of our democratic system -- ever aiming toward the supreme goals of our free society. Another factor in maintaining balance involves the element of time. As we peer into society's future, we -- you and I, and our government -- must avoid the impulse to live only for today, plundering for our own ease and convenience the precious resources of tomorrow. We cannot mortgage the material assets of our grandchildren without risking the loss also of their political and spiritual heritage. We want democracy to survive for all generations to come, not to become the insolvent phantom of tomorrow. During the long lane of the history yet to be written, America knows that this world of ours, ever growing smaller, must avoid becoming a community of dreadful fear and hate, and be, instead, a proud confederation of mutual trust and respect. Such a confederation must be one of equals. The weakest must come to the conference table with the same confidence as do we, protected as we are by our moral, economic, and military strength. That table, though scarred by many fast frustrations -- past frustrations, cannot be abandoned for the certain agony of disarmament -- of the battlefield. Disarmament, with mutual honor and confidence, is a continuing imperative. Together we must learn how to compose differences, not with arms, but with intellect and decent purpose. Because this need is so sharp and apparent, I confess that I lay down my official responsibilities in this field with a definite sense of disappointment. As one who has witnessed the horror and the lingering sadness of war, as one who knows that another war could utterly destroy this civilization which has been so slowly and painfully built over thousands of years, I wish I could say tonight that a lasting peace is in sight. Happily, I can say that war has been avoided. Steady progress toward our ultimate goal has been made. But so much remains to be done. As a private citizen, I shall never cease to do what little I can to help the world advance along that road. So, in this, my last good night to you as your President, I thank you for the many opportunities you have given me for public service in war and in peace. I trust in that -- in that -- in that service you find some things worthy. As for the rest of it, I know you will find ways to improve performance in the future. You and I, my fellow citizens, need to be strong in our faith that all nations, under God, will reach the goal of peace with justice. May we be ever unswerving in devotion to principle, confident but humble with power, diligent in pursuit of the Nations' great goals. To all the peoples of the world, I once more give expression to America's prayerful and continuing aspiration: We pray that peoples of all faiths, all races, all nations, may have their great human needs satisfied; that those now denied opportunity shall come to enjoy it to the full; that all who yearn for freedom may experience its few spiritual blessings. Those who have freedom will understand, also, its heavy responsibility; that all who are insensitive to the needs of others will learn charity; and that the sources -- scourges of poverty, disease, and ignorance will be made [to] disappear from the earth; and that in the goodness of time, all peoples will come to live together in a peace guaranteed by the binding force of mutual respect and love. Now, on Friday noon, I am to become a private citizen. I am proud to do so. I look forward to it. Thank you, and good night.";
    		System.out.println(sentence);
    	}
    }
    Java Code:
    public class EncryptionChallenge {
    	public static void main(String[] args) {
    		String key="";
    		String decryptedMessage="";
    		String encryptedMessage="LV'da)m{^v)LV'da)m{^v)LV'da)m{^)f{)A^TVv)L{dX&VC6)A{HR)CV'd)+pp)mR'Hf)'yCRH)')y{HARH)T{Y{dm)5{d)CVR)HX&VC)C{)7RCRHAXdR)XCf){5d)7RfCXdm6)CVR)C'fa){y)bRHyRTCXd&){^H)^dX{d)A{iRf)y{H5'H7v)*C)A{iRf)y{H5'H7)!RT'^fR){y)m{^v)*C)A{iRf)y{H5'H7)!RT'^fR)m{^)HR'yyXHAR7)CVR)fbXHXC)CV'C)V'f)CHX^AbVR7){iRH)5'H)'d7)7RbHRffX{d6)CVR)fbXHXC)CV'C)V'f)YXyCR7)CVXf)T{^dCHm)yH{A)CVR)7RbCVf){y)7Rfb'XH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f)CV'C)5R)YXiR)Xd)CVR)&HR'CRfC)d'CX{d){d)R'HCVv)LV'da)m{^6)BARHXT'v)I{7)!YRff)m{^v)I{7)!YRff)CVRfR)QdXCR7)NC'CRfv";
    
    		// First we display the encrypted message:
    		System.out.println("The encrypted message reads:");
    		System.out.println(encryptedMessage);
    
    		// Then we see how the message reads using this key:
    		decryptedMessage=ToolKit.decrypt(encryptedMessage, key);
    		System.out.println("The decrypted message is:");
    		/*
    		 		This is a VERY long message, so in order to make it display reasonably, we want to have each sentence on a separate line:
    		 		The method: insertNewLines(String str) will return a String with helpful line-breaks inserted!
    		 */
    		System.out.println(ToolKit.insertNewLines(decryptedMessage));
    	}
    }
    Java Code:
    import java.io.BufferedReader;
    import java.io.IOException;
    import java.io.InputStreamReader;
    
    public class Input {
    	private InputStreamReader rdr; 
    	private BufferedReader console; 
    	private boolean ready = false;
    	private boolean suppressErrorReporting;
    	public static String inString() {
    		Input input = new Input(true);
    		return input.getString();
    	}
    	public static String inString(String prompt) {
    		Input input = new Input(true);
    		return input.getString(prompt);		
    	}
    	public static int inInt() {
    		Input input = new Input(true);
    		return input.getInt();
    	}
    	public static int inInt(String prompt) {
    		Input input = new Input(true);
    		return input.getInt(prompt);		
    	}
    	public static int inInt(int defaultValue) {
    		Input input = new Input(true);
    		return input.getInt(defaultValue);					
    	}
    	public static int inInt(String prompt, int defaultValue) {
    		Input input = new Input(true);
    		return input.getInt(prompt, defaultValue);			
    	}
    	public static double inDouble() {
    		Input input = new Input(true);
    		return input.getDouble();
    	}
    	public static double inDouble(String prompt) {
    		Input input = new Input(true);
    		return input.getDouble(prompt);		
    	}
    	public static double inDouble(double defaultValue) {
    		Input input = new Input(true);
    		return input.getDouble(defaultValue);					
    	}
    	public static double inDouble(String prompt, double defaultValue) {
    		Input input = new Input(true);
    		return input.getDouble(prompt, defaultValue);			
    	}
    	public Input() {
    		suppressErrorReporting = false;
    		try {
    			rdr = new InputStreamReader(System.in); 
    			console = new BufferedReader(rdr);
    			ready = true;
    		} catch (IllegalArgumentException e) {
    			System.out.println("Stop arguing with ME!");
    		} catch (Exception e) {
    			e.printStackTrace();			
    		} catch (Error e) {
    			e.printStackTrace();
    		}
    	}
    	public Input(boolean suppressErrorReports) {
    		suppressErrorReporting = suppressErrorReports;
    		try {
    			rdr = new InputStreamReader(System.in); 
    			console = new BufferedReader(rdr);
    			ready = true;
    		} catch (IllegalArgumentException e) {
    			System.out.println("Stop arguing with ME!");
    		} catch (Exception e) {
    			e.printStackTrace();			
    		} catch (Error e) {
    			e.printStackTrace();
    		}
    	}
    	public void setErrorReporting(boolean suppressErrorReports) {
    		suppressErrorReporting = suppressErrorReports;
    	}
    	public String getString() {
    		String result = "";
    		if (ready) {
    			try {
    				result = console.readLine();
    			} catch (IOException e) {
    				if (!suppressErrorReporting) {
    					e.printStackTrace();
    				}
    			} catch(IllegalArgumentException e) {
    				if (!suppressErrorReporting) {
    					e.printStackTrace();
    				}				
    			}
    		}
    		return result;	
    	}
    	public String getString(String prompt) {
    		System.out.print(prompt);
    		return getString();
    	}
    	public double getDouble(double defaultValue) {
    		String inString = getString();
    		double result;
    		try {
    			result = Double.parseDouble(inString);
    		} catch(NumberFormatException e) {
    			if (!suppressErrorReporting) {
    				System.out.println("NumberFormatException: Cannot convert " + inString + " to a Double using parseDouble");
    			}
    			result = defaultValue;
    		}
    		return result;		
    	}
    	public double getDouble(String prompt, double defaultValue) {
    		System.out.print(prompt);
    		return getDouble(defaultValue);		
    	}
    	public double getDouble(String prompt) {
    		return getDouble(prompt, 0);
    	}
    	public double getDouble() {
    		return getDouble(0);
    	}
    	public int getInt(int defaultValue) {
    		int result;
    		String inString = getString();
    		try {
    			result = Integer.parseInt(inString);
    		} catch(NumberFormatException e) {
    			if (!suppressErrorReporting) {
    				System.out.println("NumberFormatException: Cannot convert " + inString + " to an Integer using parseInt");
    			}
    			result = defaultValue;
    		}
    		return result;
    	}
    	public int getInt(String prompt, int defaultValue) {
    		System.out.print(prompt);
    		return getInt(defaultValue);
    	}
    	public int getInt(String prompt) {
    		return getInt(prompt, 0);
    	}
    	public int getInt() {
    		return getInt(0);
    	}
    }
    Java Code:
    public class ToolKit {
    	public static String insertNewLines(String str) {
    		String newS="";
    		int periodIndex=str.indexOf(".");
    		while(periodIndex!=-1) {
    			newS+=str.substring(0, periodIndex) + ".\n";
    			str=str.substring(periodIndex+1);
    			str=stripLeadingSpaces(str);
    			periodIndex=str.indexOf(".");
    		}
    		newS+=str;
    		return newS;
    	}
    	public static String stripLeadingSpaces(String str) {
    		while (str.indexOf(" ")==0) {
    			str=str.substring(1);
    		}
    		return str;
    	}
    	public static boolean isEven(int number) {
    		return (number % 2==0);
    	}
    	public static boolean isEvenlyDivisible
    	(int number, int divisibleBy) {
    		return (number/divisibleBy==number/(double)divisibleBy);
    	}
    	public static String reverse(String myString){
    		String reversed = "";
    		for (int letterIndex=myString.length()-1; letterIndex>=0; letterIndex=letterIndex-1) {
    			String letter=myString.substring(letterIndex, letterIndex+1);
    			reversed += letter;
    		}
    		return reversed;
    	}
    	public static String lowerCase(String str) {
    		String lowerT="";
    		for (int i=0; i<str.length(); i++) {
    			String ltr=str.substring(i, i+1);
    			int caseIndex=UPPER_ALPHABET.indexOf(ltr);
    			if(caseIndex==-1) {
    				lowerT+=ltr;
    			} else {
    				lowerT+=LOWER_ALPHABET.substring(caseIndex, caseIndex+1);
    			}
    		}
    		return lowerT;
    	}
    	public static boolean isPalindrome(String s) {
    		String flc=filter(lowerCase(s)," .';:-,?");
    		return flc.equals(reverse(flc));
    	}
    	public static String filter(String str, String filter) {
    		String filteredStr="";
    		for (int i=0; i<str.length(); i++) {
    			String ltr=str.substring(i, i+1);
    			if (filter.indexOf(ltr)==-1) {
    				filteredStr+=ltr;
    			}
    		}
    		return filteredStr;
    	}
    	public static int randomNumber(int min, int max) {
    		if (max < min) {
    			int temp=min;
    			min = max;
    			max = temp;
    		}
    		return ((int)(Math.random()*(max- min + 1)) + min);
    	}
    	public static String generateKey(String str) {
    		String code=ALL_CHARACTERS;
    		return code;
    	}
    	public static String encrypt(String str,String key) {
    		String encrypted = "";
    		return encrypted;
    	}
    	public static String decrypt(String str, String key) {
    		String decrypted="";
    		return decrypted;		
    	}
    	public final static String UPPER_ALPHABET="ABCDEFGHIJKLMNOPQRSTUVWXYZ";
    	public final static String LOWER_ALPHABET="abcdefghijklmnopqrstuvwxyz";
    	public final static String DIGITS="0123456789";
    	public final static String PUNCTUATION=" ,.!@#$%^&*()[]{};:'<>-_=+";
    	public final static String ALL_CHARACTERS=UPPER_ALPHABET+LOWER_ALPHABET+DIGITS+PUNCTUATION;	
    }

  2. #2
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Transposition Cipher Decryption

    It doesn't look like a transposition cipher to me. Unless Eisenhower had decided to deliver his address in Klingon.

  3. #3
    laxbro is offline Member
    Join Date
    Jan 2013
    Posts
    7
    Rep Power
    0

    Default Re: Transposition Cipher Decryption

    really how am I suppose to make a decryption for that

  4. #4
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Transposition Cipher Decryption

    At the moment you are assuming you already know the plain text: it's E's speech. So decryption is a nonissue. To be able to write the encrypt()/decrypt() method you have to know exactly what the cipher is: because those methods are just the statement of the cipher in code.

    What you were given (the cipher text) is not the result of a transposition cipher, nor is it a simple substitution cipher (the repeated characters at the start show that) - although it might be a polyalphabetic substitution cipher or some other sort. Those repeated characters at the start don't exactly rule out a substitution cipher, but they suggest that something else is going on.

    As I understand it you begin cryptanalysis with full knowledge of what the cipher is. (Kerckhoffs's principle/Shannon's Maxim) What you are after is the key. I have a bit of a suspicion that you are being asked to guess what the cipher is, which strikes me as a little like a maths teacher asking their class to figure out a number they have just thought of...

    ---

    These are just Sunday morning ramblings, and I'm no expert, but it might clarify things a bit if you posted the question exactly as it was given to you. No-one here will do your homework for you, but plenty of people are happy to explain what it means, or make suggestions you might think about.

  5. #5
    laxbro is offline Member
    Join Date
    Jan 2013
    Posts
    7
    Rep Power
    0

    Default Re: Transposition Cipher Decryption

    This is all he gave us.
    You will use your String processing skills to create a method which can
    analyze an encrypted message using a simple transposition ciypher to find the key to
    decrypt the message. If you can determine the source of the message text or enough
    of the text to read it, you have succeeded.

  6. #6
    pbrockway2 is offline Moderator
    Join Date
    Feb 2009
    Location
    New Zealand
    Posts
    4,585
    Rep Power
    12

    Default Re: Transposition Cipher Decryption

    This is all he gave us.
    So where did the ciphertext come from? And how did you hit upon Eisenhower's speech as the plaintext? (Incidentally, it's not the same length.)

    Did you read the link describing what a transposition cipher is? This simply isn't one.

  7. #7
    laxbro is offline Member
    Join Date
    Jan 2013
    Posts
    7
    Rep Power
    0

    Default Re: Transposition Cipher Decryption

    I meant he gave us those directions and then those classes in a project.

Similar Threads

  1. Need help with cipher
    By blackknight1337 in forum New To Java
    Replies: 0
    Last Post: 04-07-2012, 04:21 PM
  2. Cipher System
    By Isaac93 in forum New To Java
    Replies: 7
    Last Post: 12-28-2011, 12:29 PM
  3. 2D Array transposition
    By Rederich in forum New To Java
    Replies: 7
    Last Post: 12-02-2011, 09:13 PM
  4. How to cipher a string without using Cipher class?
    By arnab321 in forum New To Java
    Replies: 1
    Last Post: 09-09-2009, 12:19 AM

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •