KennethWhite / defendYourCode

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

This was an assignment for my Secure Coding class to practice safely getting input from users

defendYourCode

Defend your code!

Part 1

Write a program in the language of your choice (Java, C#, C++, Python) that does the following. 
Be sure and make clear to the user what is expected:

prompts for and reads the user's first name, then last name -- each should be at most 50 characters

prompts for and reads in two int values from the user

prompts for reads the name of an input file from the user

prompts for reads the name of an output file from the user

prompts the user to enter a password, store the password, then ask the user to re-enter the password and verify that it is correct

opens the output file and writes the user's name along with the result of adding the two integer values and the result of multiplying the two integer values, followed by the contents of the input file

Your program should do whatever you feel is necessary to ensure the above information is properly obtained (meaning you must get valid input from the user) and subsequently written to the output file -- *without error*. 

Any error that does arise should be reported to either the output file specified, or an error log file.

Part 2

Now do the same thing in C!

NOTES

Your code should compile without problem using: gcc -pedantic -Wall -Wextra -Werror yourFile.c

Document any shortcomings you are able to identify with your program

Document what things you think you defended against in your code

Include your team name and member names at the top of your code

Make sure your code is clean and easy to read.

Your nefarious instructor will try and break your code / crash your program.  Make sure he cannot do this!

Turn in a zip with all your source code along with output captures from testing each of your solutions (one output capture should be for chosen language, a second capture should be for C).  Make sure your name is on all source files.  Include a README.txt that includes team member names, shortcomings, and any compilation instructions your code requires.

About


Languages

Language:Java 53.4%Language:C 42.8%Language:C++ 2.6%Language:Makefile 1.2%