Answered step by step
Verified Expert Solution
Question
1 Approved Answer
IN JAVA Write a program that performs text encryption and decryption on a certain input string First, ask the user to input a string. Then,
IN JAVA
Write a program that performs text encryption and decryption on a certain input string First, ask the user to input a string. Then, ask the user for an encryption parameter, between 1 and 30. Write a separate Class named "EncryptionHelper", This class has a static function called "Encrypt". This function accepts a String parameter, and an integer parameter. The Encrypt function iterates over each character of the input string that is passed to it. It converts each character to it's corresponding integer value in the ASCII table, and then subtracts the given encryption parameter from that number. Finally, the resulting number is converted back to a char and the sequence of characters is put together to create the encrypted string. The class Encryption Helper should also provide a function called "Decrypt. This function also accepts a string and an integer parameter, and reverses the process, to create clear text out of an encrypted stringStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started