Security is a crucial attribute of knowledge strategies. Normally, textual content material is encrypted sooner than being despatched, after which decrypted upon receipt. We want to assemble a class (or a variety of classes) encapsulating the thought of encryption. You will must test that class with a client program the place the precept methodology is located.
For this mission, encrypting consists of translating each character into one different character. As an illustration, if we take into consideration the English alphabet, along with characters a by the use of z, each character is randomly encrypted into one different, which might presumably be the equivalent character. (if you happen to occur to love, you could design your program so that no character in encrypted into itself.) To indicate this concept, we could have an array of characters for the distinctive alphabet, and one different array of characters for the encrypted alphabet.
To encrypt a phrase, each letter throughout the work is modified by the corresponding letter throughout the encrypted alphabet. For example, the phrase caged may very well be encrypted into huzsa. To decrypt a phrase, the letters throughout the encrypted phrase are modified by the corresponding letter throughout the distinctive alphabet. For example, the encrypted phrase xssa may very well be decrypted as feed.
If we have 26 completely totally different characters throughout the distinctive alphabet, then we might have 26 completely totally different characters throughout the encrypted alphabet. Furthermore, the encrypted alphabet should be randomly generated.
In your main methodology, it is best to fast the particular person for a sentence. Your program should encrypt the sentence, output the encrypted sentence, then decrypt it, and output the decrypted sentence, which should be an equivalent to the distinctive sentence that was enter by the particular person.