Question: Hi Guys can anyone help me with below code? utility class that encrypts and decrypts names. Your utility class should contain a cache of previously
Hi Guys can anyone help me with below code?
utility class that encrypts and decrypts names.
Your utility class should contain a cache of previously encrypted names so that if you encrypt or decrypt a name, the cache is checked first to see if the name is there. You can implement the cache any way you would like.
Encryption algorithm:
o Split the name into two equal parts. if it is an odd number length, then add a # at the
end of the name to make the length even. Example: Amin -> "Am" "in"
Example: Vimal -> "Vim" "al#"
o Reverse the parts and concatenate back into one string Example: Amin -> Am in -> inAm
Example: Vimal -> Vim al# -> al#Vim
o Decryption would reverse this algorithm and remove the '#' symbol if present.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
