Final Project: Hash-Based Cipher Overview The final project for this course is worth 30% of your final grade. In this project you will create a program that encrypts a string based on its character counts. Hash-Based Cipher
Added by Bego-A T.
Step 1
Sure! Here’s a step-by-step guide to creating a hash-based cipher that encrypts a string based on its character counts. Show more…
Show all steps
Your feedback will help us improve your experience
Sri K and 78 other AP CS educators are ready to help you.
Ask a new question
Labs
Want to see this concept in action?
Explore this concept interactively to see how it behaves as you change inputs.
Key Concepts
Recommended Videos
We represent the character space by _. For their secure communication, Alice and Bob use the Caesar Cipher shifting by 7 characters. Alice wants to send the following message to Bob: bed. Alice uses the encryption function E: A → A given by: E(_), E(a), E(b), E(c), E(d), E(e), E(f), E(g), E(h), E(i), E(j), E(k), E(l), E(m), E(n), E(o), E(p), E(q), E(r), E(s), E(t), E(u), E(v), E(w), E(x), E(y), E(z). Using the function E Alice encrypts the message and obtains: Note: You can earn partial credit on this problem.
Sri K.
Texts: Directions A business you are working with has a public key that they are hoping to distribute to clients. Their clients want to download the public key from a website and verify the key with a checksum. To accomplish this, you will need to code a simple string checksum verification program. In addition, you will need to document your process by completing the Module Five Coding Assignment Checksum Verification Template, linked in What to Submit. Specifically, you must address the following rubric criteria: Algorithm Cipher: Recommend an appropriate encryption algorithm cipher that avoids collisions. To do so, review the scenario and the Java Security Standard Algorithm Names, which is a standard list of algorithm ciphers provided by Oracle. Document your recommendation in the template provided. Justification: Justify your reasoning for the recommended algorithm cipher that avoids collisions. To do so, provide a brief, high-level overview of the encryption algorithm software. Consider what it means to avoid collisions. Why is this important? Document your reasoning in the template provided. Generate Checksum: Refactor the code to encrypt a text string and generate a checksum verification. To do so, first download the Module Five Coding Assignment Checksum Verification Code Base, linked in the Supporting Materials section, and upload it to Eclipse as a new project. Refactor the code to add your first and last name as a unique data string. You will submit your refactored code for your instructor to review. Then generate the checksum by following these steps: 1. Create an object of MessageDigest class using the java.security.MessageDigest library. 2. Initialize the object with your selection for an appropriate algorithm cipher. 3. Use the digest() method of the class to generate a hash value of byte type from the unique data string (your first and last name). 4. Convert the hash value to hex using the bytesToHex function. 5. Create a RESTful route using the @RequestMapping method to generate and return the required information to the web browser, including the hash value. Verification: Demonstrate that a hash value has been created for the unique text string (your first and last name) by executing the Java code. Then use your web browser to connect to the RESTful API server. It should show your first and last name as the unique data string in the browser, the name of the algorithm cipher you used, and the checksum hash value.
Akash M.
Part B. [4 marks] Part 2 Message Decoding Extend your program in Part A to decode a message based on the keys generated in Part A. The encoded message is a sequence of binary digits. The message should be decoded in multiple segments. Each segment starts with the first 3 digits to represent the length of keys to be decoded in the subsequent digits. The end of the segment is signified by a sequence of '0's of that length. With the example header in Part A, if the segment is 010100100, the segment would be decoded as follows. Segment 010 10 01 00 length of decoded decoded end of key to be to be segment 2 X ( The message may have multiple segments and ends with the binary string "000". Your program should read in the header and an encoded message; then decode the message and output the decoded message. Notes: 1. Refer to the Notes of Part A. 2. The encoded message is assumed to be in one line. 3. We assume the input is valid. Sample Input and Output Example 1 Enter Header: n(X+# $90""? Enter code:011001010100000001100111110000101000000 # 9n"X Explanation: The first segment is 011001010100000. The first 3 digits, i.e., 011 indicates the key length of this segment. The key length is followed by three characters, i.e., 001, 010, and 100. Since the key length is 3, so the first segment ends with 000. Similarly, the second segment is 00110, which contains 1 character, i.e., 1. The third segment is 011111000, which contains one character, i.e., 111. The fourth segment is 0101000, which contains one character, i.e., 10. Finally, the message ends with 000.
Recommended Textbooks
Computer Science and Information Technology
Introduction to Programming Using Python
Computer Science - An Overview
Transcript
18,000,000+
Students on Numerade
Trusted by students at 8,000+ universities
Watch the video solution with this free unlock.
EMAIL
PASSWORD