3DES File Encryption (C#)
In cryptography, Triple DES (3DES or TDES) is a symmetric-key block cipher, which applies the DES cipher algorithm three times to each data block. https://en.wikipedia.org/w/index.php?title=Triple_DES&oldid=995820064 To use 3DES functionality first off all we need to include “System.Security.Cryptography”. using System.Security.Cryptography; Then we should create and adjust an object which will do encryption: var tdese = TripleDES.Create(); tdese.Mode = CipherMode.ECB; tdese.Padding = PaddingMode.PKCS7; tdese.Key = ConvertHexStringToByteArray( "AABBCCDDEE11223344556677889900FF" ); var encryptor = tdese.CreateEncryptor(); “ConvertHexStringToByteArray” function to convert hex string to byte array: public static byte [] ConvertHexStringToByteArray ( string hexString ) { if (hexString.Length % 2 != 0 ) { throw new ArgumentException(String.Format(CultureInfo.InvariantCulture, "The binary key cannot have an od...