*USING JAVASCRIPT* 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 create a very simple encryption algorithm which will allow us to practice using some of the methods that come with the String class. Read Chapter 2 pages 70-92 and study the program "StringMethods.java" given with this assignment to see how to use some of the methods that come with the String class. Also, study the program "StudentInfo.java" given with this assignment to see how to use the methods that come with the Scanner class to read data input. Now create a new project named Chap2-Encryption. Create a new class named Encryption and **add code to do the following:** Ask the user to enter a password that is 8-20 alphanumeric characters (letters & numbers only for simplicity) and assume it was entered correctly Next, study pages 40, 74, 572 and 576-577 and use some of the String methods described on these pages to perform simple encryption on the password as follows: add the string "bentleymajor" to the beginning of the password replace each vowel character (a, e, i, o, u) to a unique non-alphanumeric character (non-letter, non-number) replace 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. See pages 74, 572, and 576-577 for information on these methods. Here is a sample output: Enter a password that contains 8-20 alphanumeric characters: LetsGoFalcons2023 ...encrypting the password... Your encrypted password is: b@ntl@ym!j$rL@tsG$F!lc$ns*^*( ...decrypting the password... Your decrypted password is: LetsGoFalcons2023
*USING JAVASCRIPT*
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 create a very simple encryption
Read Chapter 2 pages 70-92 and study the program "StringMethods.java" given with this assignment to see how to use some of the methods that come with the String class. Also, study the program "StudentInfo.java" given with this assignment to see how to use the methods that come with the Scanner class to read data input.
Now create a new project named Chap2-Encryption. Create a new class named Encryption and **add code to do the following:**
- Ask the user to enter a password that is 8-20 alphanumeric characters (letters & numbers only for simplicity) and assume it was entered correctly
- Next, study pages 40, 74, 572 and 576-577 and use some of the String methods described on these pages to perform simple encryption on the password as follows:
- add the string "bentleymajor" to the beginning of the password
- replace each vowel character (a, e, i, o, u) to a unique non-alphanumeric character (non-letter, non-number)
- replace 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. See pages 74, 572, and 576-577 for information on these methods.
Here is a sample output:
Enter a password that contains 8-20 alphanumeric characters: LetsGoFalcons2023
...encrypting the password...
Your encrypted password is: b@ntl@ym!j$rL@tsG$F!lc$ns*^*(
...decrypting the password...
Your decrypted password is: LetsGoFalcons2023
Editable code, code screenshot and output screenshot.
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 3 images