Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static String DoDecryption(String Value)
- {
- Decryptor dec = new Decryptor(EncryptionAlgorithm.TripleDes );
- dec.IV = Encoding.ASCII.GetBytes("funky");
- byte [] DecValue = Convert.FromBase64String(Value.Replace("+++","=="));
- byte [] DecKey = Encoding.ASCII.GetBytes("0123456789012345");
- byte [] DecipherValue = dec.Decrypt(DecValue,DecKey);
- return Encoding.ASCII.GetString(DecipherValue);
- }
- public static String DoEncryption(String Value)
- {
- Encryptor enc = new Encryptor(EncryptionAlgorithm.TripleDes);
- byte [] EncValue = Encoding.ASCII.GetBytes(Value);
- byte [] EncKey = Encoding.ASCII.GetBytes("0123456789012345");
- enc.IV = Encoding.ASCII.GetBytes("funky");
- byte [] CipherValue = enc.Encrypt(EncValue,EncKey);
- //InitVector = Encoding.ASCII.GetString(enc.IV);
- return Convert.ToBase64String(CipherValue).Replace("==","+++");
- }
Add Comment
Please, Sign In to add comment