A+ Work




Security is an important feature of information systems. Often, text is encrypted before being sent, and then decrypted upon receipt. We want to build a class (or several classes) encapsulating the concept of encryption. You will need to test that class with a client program where the main method is located. For this project, encrypting consists of translating each character into another character. For instance, if we consider the English alphabet, including characters a through z, each character is randomly encrypted into another, which could be the same character. (If you like, you can design your program so that no character is encrypted into itself). To represent this concept, we can have an array of characters for the original alphabet, and another array of characters for the encrypted alphabet. To encrypt a word, each letter in the word is replaced by the corresponding letter in the encrypted alphabet. To decrypt a word, the letters in the encrypted are replaced by the corresponding letter in the original. If we have 26 different characters in the original alphabet, then we have 26 in the decrypted. Furthermore, the encrypted alphabet should be randomly generated (REALLY having the hard time here). In your main method, you should prompt the user for a sentence. Your program should encrypt the sentence, output the encrypted sentence, then decrypt it, and out the decrypted. ***I know what i want to do. I want to have an array that holds the original alphabet. I was thinking that I would just go ahead and create a second array that has the alphabet encrypted already rather than creating one. I've tried numerous things and just can't get it to work. I understand the theory, but implementation I'm struggling. Here is the original alphabet already: private static final char[]origAlpha={'A','B','C','D','E','F','G','H', 'I', 'J','K','L','M', 'N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};