How do I encrypt a message that is input by the user?
I need to take a message that is input by the user, store it in memory as an encrypted text using Caesar Cipher, where the user selects a shift key number and the message is encrypted according to that key. ie. the message looks jumbled.
When the user wants to view this message, he/she needs to input that shift key and then the message will display in its normal state.
How can I store that message in memory (probably using an array) and then encrypt it using Caesar Cipher with the shift key that is entered by the user? And then how can I make sure it appears unjumbled when the user wants to view it by entering the correct shift key (upon prompt).
Thank you. :(hi):
Re: How do I encrypt a message that is input by the user?
Let the user enter a string, take the char array from this string, shift the chars with the provided shift key and convert the char array back to a string.