I know how to encrypt the test but I don’t know how to decrypt it.
Can any one please say me how can I do it.
The code I am using to encrypt the string is
string encoded = Convert.ToBase64String(Encoding.Unicode.GetBytes("USERNAME"));
string decript = Convert.ToString(encoded);
Decrypt(encoded);
I don’t know how to decrypt.
First, you’re not encrypting but encoding. Encryption typically uses a secret key (or public/private key pair) so that only the person holding the key can decrypt the encrypted message. Encoding is reversible if you know the algorithm that’s used. Encoding should not be used as a substitute for encryption; it is not secure.
Second, you simply need to reverse the process using the twin of the Convert method you’re using to do the encoding.