Plz help me solve this problem.. Qsn: One of the most basic forms of encryption is known as a Ceaser Shift cipher. This type of encryption takes a language and uses and offset of the language to substitutes a different letter for every letter. This offset works in the following way: if an offset of 1 is used, then ?a? is represented by ?b?, ?b? is represented by ?c?, and so on. When we reach the end of the alphabet and a no letter is after the current one, then we wrap around to the beginning of the language. In our current scenario ?z? is represented by ?a?. So, a Ceaser-shift of 11 would be: Original: a b c d e f g h i j k l m n o p q r s t u v w x y z | | | | | | | | | | | | | | | | | | | | | | | | | | Code: l m n o p q r s t u v w x y z a b c d e f g h i j k Note, your encryption schemes should be case insensitive, so both ?A? and ?a? should be encrypted by the same letter. The methods that you write for encryption should be put in a file named Encrypter.java. [a] Write a method called ceaserEncrypt() that accepts one parameter: the name of the file to be encrypted. This method should Ceaser shift the 26 letters of the English alphabet and output an encrypted version of the input file. The offset should be random, so that the shift will not be the same every time the program is run. Given the name of a text file, your program should input the file file1.txt and produce a Ceaser shift encrypted file ceaserFile1.txt (where ?file1? is the name of the file given to the program). Your program should also output a second file file1KeyC.txt that specifies the offset used for encoding. [b] Write a method called ceaserDecrypt() that accepts two parameters: the name of the file to be decrypted and the name of the file with the key. This method should produce a file containing the contents of the original file decrypted, and stored as decryptFileC.txt.
Take a look at the following site
http://www.thefreecountry.com/sourcecode/encryption.shtml
Regards
536 views
Usually answered in minutes!
×