Question: Text Encryption & Decryption String letters = abcdefghijklmnopqrstuvwxyz; String enc = kngcadsxbvfhjtiumylzqropwe; For example, every 'a' becomes a 'k' when encoding a text, and every

Text Encryption & Decryption

String letters = "abcdefghijklmnopqrstuvwxyz";

String enc = "kngcadsxbvfhjtiumylzqropwe"; For example, every 'a' becomes a 'k' when encoding a text, and every 'k' becomes an 'a' when

decoding.

Your program encodes (Encrypt) or decodes (Decrypt) given text using the mapping above. Capital letters are mapped the same way as the lower case letters above, but remain capitalized. For example, every 'A' becomes 'K' when encoding a text and every 'K' becomes an 'A' when decoding. Numbers and other characters are not encoded and remain the same.

Write a program: 1. Gets an input (word, sentence, paragraph ...) from user and encode it to an encrypted format.

2. Gets an encrypted text and decode to original text.

NOTE: Your program should use Command-Line Argument(s) for input. Format:java ProgName Option Text Option: -encrypt OR -decrypt (Your program should show an error message if the option is invalid)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!