Question: Encryption algorithms are commonly used today to provide security. They transform sensitive data, making it unreadable to hackers. Modern encryption algorithms are quite sophisticated, often
Encryption algorithms are commonly used today to provide security. They transform sensitive data, making it unreadable to hackers. Modern encryption algorithms are quite sophisticated, often employing random number generators.
For this project, we will make a very simple encryption algorithm which will allow us to practice using some of the methods that come with the String class.
Please follow the below steps:
make a java project:
Ask the user to enter a password that is 8-20 alphanumeric characters (letters & numbers only for simplicity) and assume it was entered correctly.
- to perform simple encryption on the password as follows:
- add the string "bentleymajor" to the beginning of the password
- change each vowel character (a, e, i, o, u) to a unique non-alphanumeric character (non-letter, non-number)
- change each digit character (0 - 9) to a unique non-alphanumeric character (non-letter, non-number)
- print the encrypted password
- now decrypt the password by performing the reverse of the operations performed above
- print the decrypted password (original password)
Hint: You will need to use string methods replace(), substring(), and length() for encrypting and decrypting the password.
Here is a sample output:
Enter a password that contains 8-20 alphanumeric characters: LetsGoFalcons2023
...encrypting the password...
Your encrypted password is: b@n..l@y..L@tsG$F!lc$ns*^*(
...decrypting the password...
Your decrypted password is: LetsGoFalcons2023
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
