Breakout Lab 10 Rot13 Encryption Implemented in C Learning Objectives Get experience using arrays, strings, and pointers using the C programming language. Get experience implementing a simple...

1 answer below »
Ccoding


Breakout Lab 10 Rot13 Encryption Implemented in C Learning Objectives Get experience using arrays, strings, and pointers using the C programming language. Get experience implementing a simple encryption algorithm Problem / Exercise According to Wikipedia, https://en.wikipedia.org/wiki/ROT13, “ROT13” (“rotate by 13 places”) is a simple letter substitution cipher that replaces a letter with the letter 13 letters after it in the alphabet. ROT13 is a special case of the Caesar cipher, which was developed in ancient Rome. Because there are 26 letters (2 ⇥ 13) in the basic Latin alphabet, ROT13 is its own inverse; that is, to undo ROT13, the same algorithm is applied. Thus, the same algorithm can be used for encryption and decryption. The algorithm provides virtually no cryptographic security, and it is often cited as a canonical example of weak encryption. Your task for this lab is to write a C program that implements ROT13 with a single string entered as a command line argument. Requirements 1. Read through the examples, the aforementioned Wikipedia page, and the instructions in this assignment. 2. Implement this lab in a C source file called lab10.c, and use our provided Makefile to create an executable called lab10.out. Do not modify our Makefile. Your source code must compile correctly without any modifications to our Makefile, which means you must use the C programming language (do not use C++ language features that are not part of the C language; otherwise you may receive a failing grade on this assignment). 3. Your program must rotate all characters ‘A’ through ‘Z’ and ‘a’ through ‘z’ correctly. Non-letter characters should not changed as shown in the examples. 4. Your program’s I/O must match the examples found in the Examples section. 5. You may assume valid input for this lab, which will be a single string inputted as the second command line argument. Examples After you finish implementing lab10.c, the I/O from running lab10.out should match exactly what is shown below. Note how the operating system can pass a string to your program in di↵erent ways: using single quotation marks, using double quotation marks (or its escape sequence), or using no quotation marks if the string has no spaces. ./lab10.out ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm ./lab10.out NOPQRSTUVWXYZABCDEFGHIJKLMnopqrstuvwxyzabcdefghijklm ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ./lab10.out "Why did the chicken cross the road?" Jul qvq gur puvpxra pebff gur ebnq? ./lab10.out "To get to the other side" Gb trg gb gur bgure fvqr ./lab10.out 'Mbrl vf Njrfbzr!!!' Zoey is Awesome!!! 1 Sam Kondla Sam Kondla Sam Kondla Sam Kondla Sam Kondla Sam Kondla Sam Kondla Sam Kondla Sam Kondla ./lab10.out 'Jvagre Vf Pbzvat.' Winter Is Coming. ./lab10.out "valar morghulis" inyne zbetuhyvf ./lab10.out "\"valar\"'morghulis'" "inyne"'zbetuhyvf' 1 C Program 1.1 Setup Make sure that all of your files are in a directory called LastName-FirstName-lab10, where LastName and FirstName are replaced with your actual last and first names, respectively. 1.2 Code For this lab, you should place your code in lab10.c and follow the instructions aforementioned. 1.3 Coding Style Requirements 1. All functions must be commented. Comments must include a brief description of what the function does, its input(s), its output, and any assumptions associated with calling it. If your function has a prototype and an implementation separated into di↵erent parts of your source code, then you only need to put the comments for that function above its prototype (there is no need to comment both the prototype and implementation; commenting one is su�cient). 2. Each function in your source code must not exceed 30 lines of source code, and this rule applies to all functions in your source code. Functions that exceed 30 lines of source code must be split up into smaller functions, where each smaller function does not exceed 30 lines of source code. 3. All classes, structs, unions, and enums must be commented. 4. All global and static variables must be commented. 5. All identifiers must be named well to denote their functionality. Badly named identifiers are not allowed. For example, identifiers like a, aaa, b, bbb, bbbb are bad names for identifiers. 6. Every line of source code must be indented properly and consistently. 1.4 Other Requirements 1. Your program cannot contain a memory leak when executed. You are responsible for using valgrind to test your program to ensure it does not contain a memory leak, and valgrind should be run for every test case for your program. A program that contains one or more memory leaks (definitely, indirectly, or possibly lost) identified by valgrind may lose points. 2. All written and verbal instructions stated by the teaching sta↵ (lecture instructor, lab instructor(s), etc.) must be followed for this assignment. Failure to follow instructions may result in losing points. 1.5 Makefile Include the provided Makefile. 1.6 README File Make sure to include a README file that includes the following information presented in a reasonably formatted way: Instructions on how to compile and run your program. If you setup your submission to include a Makefile, then these instructions are pretty simple. 2 3 Grading: 10 points If your program does not compile on using the required compiler for this class and the provided Makefile, then you’ll receive a grade of zero on this assignment. Otherwise, your program will will be graded using the criteria below. Program runs correctly with various test cases on 10 points Makefile is missing from your submission or is incorrect -1 point README file is missing or is filled out incorrectly -1 point Not submitting to on -1 point Late penalty for submitting 0 hours to 24 hours late -2 points One or more compiler warnings -2 points Not adhering to one or more coding style requirements -2 points Not submitting this assignment before its late period expires -10 points Penalty for not following instructions (invalid I/O, etc.) Penalty decided by grader You must test, test, and retest your code to make sure it compiles and runs correctly on . This means that you need to create many examples on your own (that are di↵erent than the aforementioned examples) to ensure you have a correctly working program. Your program’s I/O must match the examples given in the Examples section. We will test your program with valid inputs. 3 Sam Kondla C Program Setup Code Coding Style Requirements Other Requirements Makefile README File Submission Grading: 10 points
Answered Same DayApr 05, 2022

Answer To: Breakout Lab 10 Rot13 Encryption Implemented in C Learning Objectives Get experience using arrays,...

Ashish answered on Apr 05 2022
90 Votes
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here