Implement the affine cipher

Assignment Help JAVA Programming
Reference no: EM131454080

To implement Affine Cipher and S-DES in any programming language with your preference. But you are required to finish this assignment independently and strictly follow the requirements. In your assignment, please pay attention to your writing skills in grammar checking, typos, etc..

1. Implement the Affine Cipher (see lecture notes) in one programing language and make sure that the following requirements are satisfied.

- You need to have a separate code file to testify whether a given key (a,b) is eligible.
- You have separate functions for encryption and decryption and also your code should work for both encryption and decryption for any given eligible key. (After decryption, the original plaintext should be recovered).
- You code should be capable to encrypt and decrypt both capital and lower case letters (ignore other non-letter symbols).
- You code should work for the given test file. (Able to encrypt and decrypt correctly).
After implementing your code, you MUST answer the following questions in your hard copy submission.

- Compute all possible eligible keys you can use and justify your computation.
- If your code works properly with some selected eligible key, show recovered plaintext after decryption and compare with the original plaintext file; (the test file is given in the unit website). State the possible reasons if not working properly.
- Mathematically prove the decrypted message equals to the original message with critical logical reasoning.
- Use your code in the Tutorial 1, print out the letter distribution with a graph chart for the given test file.
- Submit your code in your hard copy assignment.
- Print out the first page and last page of decrypted file and compare it with the original plaintext, are they the same?

2. Implement S-DES in any programming language. The requirements are follows:
- Your code should be able to encrypt and decrypt all possible characters on a keyboard.
- The key for encryption and decryption is required to be any combination of characters in a keyboard with finite length (You need to do padding or chopping if necessary.)
- You are required to implement key generation, switch function and Fk as three separate functions (You should have these three functions separately in your hard copy) and then combine all of these operations to achieve S-DES.
- Make sure it works properly for the given test file.
- Change the elements in all S-boxes with the required constraint (S-Box elements are required to be between 0-3) and check whether your code still works as expected.
Now you can answer the following questions in your hard copy submission after you have done all above.

- Mathematically prove S-DES works (After decryption, you can obtain the original plaintext).
- State your pseudo code structure based on the three separate required functions.
- State clearly what is the main difficulty in the process of your programming if your code is not working properly?
- Print out and submit the outputs for encryption and decryption for a test file given in the unit website. (Only the first page and last pages are required for hard copy.)
- Print out and submit a hard copy of your code with structure explanation by using the three functions (make sure this structure looks nice).
- Try to do encryption and decryption with a key of all 1's, and report your findings.

You need to report your design/progress and demonstrate your code in the lab for above two questions. Make sure that answers in your hard copy are consistent with your live demo in lab.

3. Based on your understanding on the lecture notes 1-4 (from lecture one to lecture four), answer the following questions. (5 Marks)
- How many types of threats in information transmission?
- What is source coding in information transmission?
- What is coding/error coding in information transmission?
- In your code of S-DES, which step is source coding? Which step is coding/error coding?
- In your code of S-DES, which step is confusion? Which step is diffusion?

Attachment:- C-SDES.pdf

Verified Expert

The solution file is prepared in netbeans and implemented simplified DES algorithm to generate two keys in bits and read plain text from file to convert plain text to encrypt using keys and decrypt the same message with same keys.The screen shot of the program and explanation of the program attached. Each and every line of the program commented as per client requirement.

Reference no: EM131454080

Questions Cloud

What is the total annual holding costs to the factory : A workpart costing $80 is processed through the factory. The manufacturing lead time for the part is 12 wk, and the total time spent in processing during.
What is your personal philosophy of ethics in general : What does the 2015 AAMFT Code of Ethics include that is relevant to this scenario?What does the recent MFT literature say about ethics in situations like this?
Environmental or organizational pressures : In order for managers to respond effectively to environmental or organizational pressures that can be disruptive to an organization.
Compute inventory at lower of cost or net realizable value : A list of the adjusting journal entries with supporting calculations as necessary. A calculation of inventory at the lower of cost or net realizable value.
Implement the affine cipher : Implement the Affine Cipher in one programing language and make sure that the following requirements are satisfied.
What is imputed holding cost per unit based on data given : A two-bin approach is used to control inventory for a certain low-cost hardware item. Each bin holds 500 units of the item.
Projects and typical business activities : For most companies, projects and typical business activities can be described as routine.
What makes the psychoanalytic-social perspective of uniquel : What are the main components of each of the psychoanalytic-social personality theories? What are some of the main differences between theories?
Individualism of american culture : Considering the economic and political climate of competitive business, the individualism of American culture, and the increasingly powerful forces of lean.

Reviews

inf1454080

4/21/2017 6:32:14 AM

Okay, it compiles and runs....But the output is incorrect, see the attachment below, you will know what I'm talking about. Use the test file, as attached below to do the testing. Firstly, the plaintext should be the entire file characters, then after decryption, we should recover the original message back(plaintext) 22623483_1Capture.PNG 22623483_2testfile.txt yes now it works. But only one thing, if i try to input a different key string e.g "hello" not "abcd", it will still produce the same sub keys when using "abcd". I dont think that is valid? here is an example. 22623466_1Capture.PNG 22623466_2Capture1.PNG Yes, I checked Your output. You got different sub keys for different key string values. For hello String u got K1 - 10110100 K2 - 01000111 For abcd String U got K1 - 10110111 K2 - 01111011 For hello String u got K1 - 10110100 K2 - 01000111 For abcd String U got K1 - 10110111 K2 - 01111011 Are string values of the key values are same ? Could you please cross check it. Okay, sorry. My mistake.. Thank you.

inf1454080

4/21/2017 6:32:03 AM

That is constructor name ... it should be ur class name. ur class name is simplfiedDES not check. Here i have attached program just create a java class as simplifiedDES and save as same name. please follow my instruction so that u will not get any problem to compile and run the code. u can see the output also. the code has been modified as the expert says, changed the name and it compiles, but does not run. See the attachment to show what the error is. 22623491_1Capture.PNG Your class name is SimplifiedDES not Simplifiedes and it is case sensitive also. Kindly check your class name spelling and save as your file as class name with extension of .java. Yes, i also changed to SimplifiedDES.java but it still shows the same error. I am sure that the file is also in the correct directory. 22623473_1Capture.PNG

inf1454080

4/21/2017 6:31:43 AM

Okay, i see the problem here. From the requirements sheet it specifies that "the key for encryption and decryption is required to be any combination of characters in a keyboard with finite length (you need to do padding or chopping if necessary). This means that the key is not in binary at first. you input as a string of characters (in any sequence) and then from those sequence you convert them into 10-bit binary. From the solution, it shows that we directly insert key as integer binary, not string. which is not the requirement of the assignment. Here i changed key value as string and did padding to generate key 1 and 2. when compiling, it shows error: Check A = new Check(K); cannot find symbol symbol: class Check location: class SimplifiedDES screenshot of the error. 22623490_1attach1.PNG

inf1454080

4/21/2017 6:31:24 AM

Yes for SDES, S0, S1, P10, P8 are all the same, no doubt about that. But my main concern is that the main code, is the same, all functions performed is same. There is no other way of doing such apart from using "<<". How about the String message is put into an array (since one character in a string contains 8 bits) and also the plain text is supposed to be 8 bit block. Then the key is also a string at first, but if we can convert it into 10-bit, using an array we can perform the shifts. Isn't it? Already I have given clear explanation about the program n comments on each n every line. You asked without array how to read file string. I used while loop to read each character and stored as a string then I convert that string value to radix 2 so I ll get m value as integer which I used all my methods.. Okay, when i try to compile the code, it compiles but it does not run, even though the class is in the correct directory when I am running it. How comes?. This is what it shows...see the attachment below 22623471_1attach.PNG Please Check your class name and your class name and file name should be same then only it can run. yes it is the same I have checked it

inf1454080

4/21/2017 6:31:02 AM

I hope you have read the requirements and notes provided/attached in this chat? This is the test file 22623492_1testfile.txt Comments have not been provided, explaining how the code works? If no comments, then a readme.txt showing how each function works? Please do as I do not want to be plagiarized. I hope you can understand. Here i had attached program with comments for each and every line. As per your assignment instruction we can not use inbuilt function in program so shifting and xor operation can perform by the way of " << " operator only. We do not have other way. If you consider any problem of the SDES the S0 and S1 values will be same and p10 and p8 values are same. It is algorithm we can not modify that so I initialize all variable with algorithm values. I had also attached one more document for how i did this program with explanation and example. You can check the main coding its not copied from anywhere.

inf1454080

4/21/2017 6:30:32 AM

How much would it cost to do only Question 2? Note: It should be plagiarism free as well. It gave me a warning, that the details I have put in maybe sent over an insecure connection and maybe viewed by a third party. So I cant risk it. Okay payment has been made Can you please confirm? Requirements for the assignment: 1) Please look at the attached files provided, for the procedure of simplified DES. 2) I will upload the lecture notes for S-DES and DES with this message. 3) Please do not use java libraries for encryption and decryption. All the code should be done manually and not the use of libraries. This is the purpose of the assignment. 4) It should be plagiarism free 5) Please provide enough comments on the code to make it understandable and readable, or a readme.txt to explain how each function/code works This is the lecture notes 22623497_1lect4-DES-17.pdf

len1454080

4/7/2017 4:58:21 AM

Should be implemented in Java, S-DES follows the same structures as the file provided - You need to report your design/progress and demonstrate your code in the lab for above two questions. Make sure that answers in your hard copy are consistent with your live demo in lab.

Write a Review

JAVA Programming Questions & Answers

  Recursive factorial program

Write a class Array that encapsulates an array and provides bounds-checked access. Create a recursive factorial program that prompts the user for an integer N and writes out a series of equations representing the calculation of N!.

  Hunt the wumpus game

Reprot on Hunt the Wumpus Game has Source Code listing, screen captures and UML design here and also, may include Javadoc source here.

  Create a gui interface

Create GUI Interface in java programing with these function: Sort by last name and print all employees info, Sort by job title and print all employees info, Sort by weekly salary and print all employees info, search by job title and print that emp..

  Plot pois on a graph

Write a JAVA program that would get the locations of all the POIs from the file and plot them on a map.

  Write a university grading system in java

University grading system maintains number of tables to store, retrieve and manipulate student marks. Write a JAVA program that would simulate a number of cars.

  Wolves and sheep: design a game

This project is designed a game in java. you choose whether you'd like to write a wolf or a sheep agent. Then, you are assigned to either a "sheep" or a "wolf" team.

  Build a graphical user interface for displaying the image

Build a graphical user interface for displaying the image groups (= cluster) in JMJRST. Design and implement using a Swing interface.

  Determine the day of the week for new year''s day

This assignment contains a java project. Project evaluates the day of the week for New Year's Day.

  Write a java windowed application

Write a Java windowed application to do online quiz on general knowledge and the application also displays the quiz result.

  Input pairs of natural numbers

Java program to input pairs of natural numbers.

  Create classes implement java interface

Interface that contains a generic type. Create two classes that implement this interface.

  Java class, array, link list , generic class

These 14 questions covers java class, Array, link list , generic class.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd