Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Problem Statement: You are asked to develop a password encryption program to set new passwords and provides the option to encrypt and decrypt them. Problem

image text in transcribedimage text in transcribed

Problem Statement: You are asked to develop a password encryption program to set new passwords and provides the option to encrypt and decrypt them. Problem Description: Your program should provide to the following requirements: Your program will read the password from the user and check if it is valid or not. o Valid passwords are of length between 6 to 20 characters and should start with digit. The user has only 2 tries to set correct password, if the user failed with 3 tries to set valid password the application will terminate with error massage. Your program will encrypt the password according to the following algorithm: o Reverse the first half of the password and shift it to the password end. o The even characters will be in reveres order and the odd characters will be in their place. Each two consecutive characters will be swapped together. Example: Original password is : 4A$CDEF9 Password after step 1: DEF9C$A4 Password after step 2: D4F$C9AE Password after step 3: 4D$F9CEA Your program will decrypt the password to get the original one based on the same encryption algorithm Example: The encrypted password is: 4D$F9CEA Original password is : 4A$CDEF9 Programing Specifications: 1. Your are asked to develop a class named Password with the members described in the following UML diagram: class Password -pass: string + Password: + readPassword (): void + encryptPassword (): void + decryptPassword (): void + printPassword() const: void A class constructor to initialize the pass member to empty string. The readPassword function to input a valid password from the user and set it to pass member. The encryptPassword function that will encrypt the pass member according the algorithm discussed in the description part. The decryptPassword function that will decrypt the pass member according the same algorithm used in encryption process. The printPassword function to print the pass member

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions