Develop a program that will perform security authorisation

Assignment Help Programming Languages
Reference no: EM131419021

Assignment

You are required to develop a program that will perform security authorisation based on access codes. The access codes are 4 single-digit integer numbers between 0-9. The program should allow a user to enter a code, encrypt the number and compare it to an authorised access code. The program should also allow the user to decrypt an encrypted code.

When your program begins executing, the default authorised access code is 4523 (encrypted form of 1234 - see encryption algorithm below). This code must be stored in a 1-D array called access_code and should not be changed. You should use a different 1-D array to read the code entered by the user.

Your program should be menu-driven and must display a simple menu when run. The menu should include the following options:

1. Enter code
2. Encrypt code and verify if correct (i.e., matches authorised access code)
3. Decrypt code
4. Display the number of times the code was entered (i) Successfully (ii) Incorrectly
5. Exit Program

Note:

• Each menu option must be implemented in a separate function, i.e. modularized.
• All functions must pass parameters using Pass by Reference. Do NOT pass parameters using pass by value.
• All reading and writing to/from arrays must use pointer notation - not subscript notation (i.e. using [ ])

Requirements:

(Each implemented in a separate function):

1. Enter 4 single-digit integers. Perform any necessary validation (errorchecking).
2. Encrypt the code entered. You should use the following algorithm to encrypt the 4 single-digit integers:

Encryption Algorithm:

- Swap the 1st number with the 3rd number.
- Swap the 2nd number with the 4th number.
- Add 1 to each number. - If any number has a value equal to 10, change this value to 0.

3. Compare the encrypted number from step 2 with the access code (4523) stored in the 1-D array called access_code. If the 2 codes match, display a message saying CORRECT CODE. If the 2 codes do not match, display a message saying ERROR CODE.

4. Provide an option to allow a user to decrypt an encrypted code. You should use the following algorithm to decrypt the encrypted code only:

Decryption Algorithm:

- Subtract 1 from each number.
-If any number has a value equal to -1, change this value to 9.
- Swap the 1st number with the 3rd number.
- Swap the 2nd number with the 4th number.

5. Count the number of times a user entered a correct/incorrect code after it is encrypted and compared to the access code in each run of the program.

6. The program should terminate gracefully.

Features to include:

• After each option has finished, your program should return to the main menu and allow the user to select another option.
• The user should only be allowed to encrypt their code (i.e. select option 2) if the code is NOT already encrypted.
• The user should only be allowed to decrypt their code (i.e. select option 3) if the code IS already encrypted.
• Only encrypted codes should be compared with the access-code (option 2).
• Display appropriate error messages to handle any errors.

Reference no: EM131419021

Questions Cloud

How do the different roles of system software affect you : How do the different roles of system software and application software affect you as a business end-user? How do you see this changing in the future?
Compensation analysts for an insurance company : As a compensation analysts for an insurance company in Hartford, Connecticut, define the relevant labor market for insurance claims adjusters and for data entry clerks. Please provide support for your answer.
Manage underperforming department of business : Imagine that you are hired to manage an underperforming department of a business. Upon assessing day to day operations for a period of time, you observe that there appears to be a good deal of confusion in the department. The problems run the gamut f..
Case study-downsizing and appraisals at dbart : Seminar Three Case Study: Downsizing and Appraisals at DBart  (Submit to Assignment Link Day Six) Make sure that your solution is grounded in economic reality and is in compliance with Title VII.
Develop a program that will perform security authorisation : You are required to develop a program that will perform security authorisation based on access codes. The access codes are 4 single-digit integer numbers between 0-9.
Pros and cons of launching lightening bolt : From a management perspective, what do you see as the pros and cons of launching Lightening Bolt?
Article on diversity and promise fulfillment by organization : After reading the Buttner, Lowe, and Billings-Harris (2010) article on diversity and promise fulfillment by organizations, discuss your thoughts on how organizations, and your organization in particular, can use this information to better understa..
What kinds of changes occur when emotional wounds : Maya Lin said that the Memorial was meant to help people confront their pain. What kinds of changes occur when emotional wounds begin to heal - DISCUSS AND COMPARE Edgar Heap of Birds Most Serene Republic memorial and Wheel to Maya Lin's Vietnam..
Seniority versus merit pay : Compare and contrast seniority (longevity) pay with merit pay. Determine the advantages and disadvantages of each, including specific examples to support your response.

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

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

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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