Question

Option 1: Authentication System For security-minded professionals, it is important that only the appropriate people gain...

Option 1: Authentication System

For security-minded professionals, it is important that only the appropriate people gain access to data in a computer system. This is called authentication. Once users gain entry, it is also important that they only see data related to their role in a computer system. This is called authorization. For the zoo, you will develop an authentication system that manages both authentication and authorization. You have been given a credentials file that contains credential information for authorized users. You have also been given three files, one for each role: zookeeper, veterinarian, and admin. Each role file describes the data the particular role should be authorized to access. Create an authentication system that does all of the following:

  

 

 

You are

Asks the user for a username
Asks the user for a password
Converts the password using a message digest five (MD5) hash

o It is not required that you write the MD5 from scratch. Use the code located in this document and follow the comments in it to perform this operation.

Checks the credentials against the valid credentials provided in the credentialsfile

o Usethehashedpasswordsinthesecondcolumn;thethirdcolumncontainstheactualpasswordsfortestingandthefourthrowcontains the role of each user.

Limits failed attempts to three before notifying the user and exiting the program
Gives authenticated users access to the correct role file after successfulauthentication

o The system information stored in the role file should be displayed. For example, if a zookeeper’s credentials is successfully authenticated, then the contents from the zookeeper file will be displayed. If an admin’s credentials is successfully authenticated, then the contents from the admin file will be displayed.

Allows a user to log out
Stays on the credential screen until either a successful attempt has been made, three unsuccessful attempts have been made, or a user chooses to exit

allowed to add extra roles if you would like to see another type of user added to the system, but you may not remove any of the existing roles.

Specifically, the following critical elements must be addressed:

I.

Process Documentation: Create process documentation to accompany your program that addresses all of the followingelements:

Problem Statement/Scenario: Identify the program you plan to develop and analyze the scenario to determine necessary consideration for

building your program.

Overall Process: Provide a short narrative that shows your progression from problem statement to breakdown to implementation strategies. In other words, describe the process you took to work from problem statement (your starting point) to the final product. Your process description should align to your end resulting program and include sufficient detail to show the step-by-step progress from your problem statement analysis.

Pseudocode: Break down the problem statement into programming terms through creation of pseudocode. The pseudocode should demonstrate your breakdown of the program from the problem statement into programming terms. Explain whether the pseudocode differs from the submitted program and document any differences and the reason forchanges.

Methods and Classes: Your pseudocode reflects distinct methods and classes that will be called within the final program. If the pseudocode differs from the submitted program, document the differences and reason for changes.

Error Documentation: Accurately document major errors that you encountered while developing yourprogram.

Solution Documentation: Document how you solved the errors and what you learned from them.

Program: Your working program should include all of the specified requirements. The comments within your program will count toward the assessment of the documentation aspects of your submission.

A. Functionality

Input/Output: Your program reads input from the user and uses system output.

Control Structures: Your program utilizes appropriate control structures for program logic.

Libraries: Your program utilizes standard libraries to pull in predefined functionality.

Classes Breakdown: Your program is broken down into at least two appropriateclasses.

Methods: Your program utilizes all included methods correctly within the classes.

Error Free: Your program has been debugged to minimize errors in the final product. (Your program will be run to determine functionality.)

AI.

B. Best Practices: These best practices should be evident within your working program and process documentation.

Formatting Best Practices: Provide program code that is easy to read and follows formatting best practices as defined by the industry,

such as with indentation.

Documentation Best Practices: Include comments where needed within the program in appropriate detail for communicating purpose, function, and necessary information to other information technology (IT) professionals.

Coding Best Practices: Ensure your program supports clean code through descriptive variablenames.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

/ import library files import java.io.BufferedReader; import java.io.FileReader; import java.io. IOException; import java.io.

attempts System. out.println (Enter Username) string user buffer.readLine) System. out.println(Enter Password); String pa

while ((currentLine - file.readLine ()) !- null) // split the line where the tab İs present string arrcurrentLine.split ( /7

System. out.println (Please try again.) System.out.println (attempts+ more attemptes left. \n) Jwhile (attempts>0) catch

Sample Output:

Login

Enter Username
xyz
Enter Password
aaaaa
Invalid Username or Password.
Please try again.
2 more attemptes left.

Enter Username
rosario.dawson
Enter Password
animal doctor
Hello, System Admin!

As administrator, you have access to the zoo's main computer system. This allows you to monitor users in the system and their roles.
Press 999 for log out

999

Login
Enter Username
bruce.grizzlybear
Enter Password
letmein
Hello, System Admin!

As administrator, you have access to the zoo's main computer system. This allows you to monitor users in the system and their roles.
Press 999 for log out

999

Login
Enter Username

Sample Output 2:

Login
Enter Username
abc
Enter Password
123
Invalid Username or Password.
Please try again.
2 more attemptes left.

Enter Username
abc
Enter Password
124
Invalid Username or Password.
Please try again.
1 more attemptes left.

Enter Username
abc
Enter Password
125
You are attempted to login more then three times
Exiting...

credentials.txt

griffin.keyes 108de81c31bf9c622f76876b74e9285f "alphabet soup" zookeeper

rosario.dawson 3e34baa4ee2ff767af8c120a496742b5 "animal doctor" admin

bernie.gorilla a584efafa8f9ea7fe5cf18442f32b07b "secret password" veterinarian

donald.monkey 17b1b7d8a706696ed220bc414f729ad3 "M0nk3y business" zookeeper

jerome.grizzlybear 3adea92111e6307f8f2aae4721e77900 "grizzly1234" veterinarian

bruce.grizzlybear 0d107d09f5bbe40cade3de5c71e9e9b7 "letmein" admin

Code to copy:

//import statements

import java.io.BufferedReader;

import java.io.FileReader;

import java.io.IOException;

import java.io.InputStreamReader;

import java.security.MessageDigest;

import java.security.NoSuchAlgorithmException;

import java.util.Scanner;

//Create a class Authentication

public class Secretproc

{

// main() method

public static void main(String[] args) throws IOException

{

// Call loginScreen() method

loginScreen();

}

// loginScreen() method for user login

public static void loginScreen()

{

// Declare variables

String genPwd = "";

int flag = 0, attempts = 3;

// Create an object 'br' for BufferedReader class to accept data from

// user and read data from a file

BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

System.out.println("\nLogin");

try {

do {

attempts--;

System.out.println("Enter Username");

String uName = br.readLine();

System.out.println("Enter Password");

String pwd = br.readLine();

// Create the object 'md' for the MessageDigest class to convert

// password in md5

MessageDigest md = MessageDigest.getInstance("MD5");

md.update(pwd.getBytes());

byte[] bytes = md.digest();

// Create the object for String

StringBuilder sb = new StringBuilder();

for (int j = 0; j < bytes.length; j++)

{

sb.append(Integer.toString((bytes[j] & 0xff) + 0x100, 16).substring(1));

}

genPwd = sb.toString();

//System.out.println("Password entered by you:" + genPwd);

String currentLine;

// Open credentials.txt file

BufferedReader bin = new BufferedReader(new FileReader("credentiail.txt"));

// Check the username and password from the file

// Read the each line from the file

while ((currentLine = bin.readLine()) != null)

{

// Split the line where the tab is present

String[] arr = currentLine.split(" ");

// Check username

if (arr[0].equals(uName))

{

// Check password

if (arr[1].equals(genPwd))

{

flag = 1;

break;

}

}

}

// Checks if the user enters more then 3 attempts

if (attempts == 0)

{

System.out.println("You are attempted to login more then three times");

System.out.println("Exiting...");

System.exit(1);

}

// If username and password is true

if (flag == 1)

{

// Call adminScreen() method

adminScreen();

break;

}

// If invalid username and password

else

{

System.out.println("Invalid Username or Password.");

System.out.println("Please try again.");

System.out.println(attempts + " more attemptes left.\n");

}

} while (attempts>0);

}

catch (NoSuchAlgorithmException e)

{

e.printStackTrace();

}

catch (IOException e)

{

e.printStackTrace();

}

}

// Create adminScreen() method

public static void adminScreen()

{

String logOut;

// Create Scanner class object to accept data from the user

Scanner sc = new Scanner(System.in);

System.out.println("\nWelcome Admin");

System.out.println("Press 999 for log out\n");

// Accept data from the user

do

{

logOut = sc.nextLine();

} while (!logOut.equals("999"));

// If the user want to exit from admin screen

if (logOut.equals("999"))

{

// Call login screen

loginScreen();

}

}

}

1. Process Documentation: Process documentation containing all of the following elements:

A. Problem Statement/Scenario: Class Secretproc is defined to solve the problem. Problem is to make an authorized system for login. If username and password will be matched only then a user can login the system.

B. Overall Process: Problem is divided into further methods. Like a method named adminScreen() to welcome the admin of the system and to display the welcome message.

Another method loginScreen() to read the username and password from the file and read the filenames and match by the username and password entered by the user.

C. Pseudocode: Whole program is breakdown into different methods of the class.

loginScreen() method to get login in the system. For login user has to match the username and password entered by the user to the data stored in the credential.txt file.
adminScreen() method to display the message on the screen when user get login in the system.
Main() method to call other methods of the class.​​
D. Methods and Classes: class Secretproc is there that is used in the program.

Methods used in the program are loginScreen() and adminScreen() and main method.

E. Error Documentation: Errors can be occurred if file would not be created correctly.

F. Solution Documentation: Solution Document gives all the output of the program and that will be error-free.

Add a comment
Know the answer?
Add Answer to:
Option 1: Authentication System For security-minded professionals, it is important that only the appropriate people gain...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Java Netbeans code Option 1: Authentication System For security-minded professionals, it is important that only the...

    Java Netbeans code Option 1: Authentication System For security-minded professionals, it is important that only the appropriate people gain access to data in a computer system. This is called authentication. Once users gain entry, it is also important that they only see data related to their role in a computer system. This is called authorization. For the zoo, you will develop an authentication system that manages both authentication and authorization. You have been given a credentials file that contains credential...

  • I need help ASAP on this, this is due at midnight PST. This is the current...

    I need help ASAP on this, this is due at midnight PST. This is the current code I have. How can I allow the user to quit. My counting while loop works fine, but I would like it to not keep outputting username if a file was successfully opened. This is what is required. Prompt You have assumed the role of managing the technology infrastructure at a zoo. You will develop a working program (either an authentication system or a...

  • Develop a functional flowchart and then write a C++ program to solve the following problem. 1....

    Develop a functional flowchart and then write a C++ program to solve the following problem. 1. Create a text file named c1.txt and write your brand of computer (like Dell, HP, etc) in the file. You will be reading the name of the file from the keyboard as a string, using the string class. Your program will also read the brand of your computer from the keyboard. The process of the file creation (name of the file, mode for opening...

  • Create a JAVA program for a Kiosk management system. A local kiosk in your neighborhood has...

    Create a JAVA program for a Kiosk management system. A local kiosk in your neighborhood has been heavily challenged by the manual system currently used to manage the kiosk’s day to day operations. The kiosk management have been informed of your newly acquired knowledge in application development and have approached you to create an electronic management system. The system is meant to help the Kiosk in managing its stock and finances; with this in mind your application should then offer...

  • (Assignment 1 : Question 1) C Mini Project is a mini application that could be developed...

    (Assignment 1 : Question 1) C Mini Project is a mini application that could be developed using C language that involves the concepts of arrays, functions, read and write data techniques. Based on your creativity, you are required to plan, design and develop a mini application for an organisation. You may choose to from the list below or propose your own mini application: 1. Appointment Management System (I prefer to choose this) Your responsibility is to ensure that this project...

  • i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due...

    i need help with a mips program to to covert roman numerals to real numbers Lab 4: Roman Numeral Conversion Part A: Due Sunday, 19 May 2019, 11:59 PM Due Friday, 24 May 2019, 11:59 PM Part B: Minimum Submission Requirements Ensure that your Lab4 folder contains the following files (note the capitalization convention): o Diagram.pdf o Lab4. asm O README.txt Commit and push your repository Lab Objective In this lab, you will develop a more detailed understanding of how...

  • I have this assignment that I need help with, I turned it in but I got...

    I have this assignment that I need help with, I turned it in but I got a bad grade for it, could someone please help me take an overview of it or take a look at it. but I want to change the project to Fundraising for kids in need all over the world. Because there is an assignment that I did in the past that is connected to it. Develop a work breakdown structure (WBS) for the project. Break...

  • A new version of the operating system is being planned for installation into your department’s production...

    A new version of the operating system is being planned for installation into your department’s production environment. What sort of testing would you recommend is done before your department goes live with the new version? Identify each type of testing and describe what is tested. Explain the rationale for performing each type of testing. [ your answer goes here ] Would the amount of testing and types of testing to be done be different if you were installing a security...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT