Chilkat
HOME
Android™
ASP
Visual Basic
VB.NET
C#
iOS (IPhone)
Objective-C
C++
C
MFC
Delphi
FoxPro
Java
Perl
PHP Extension
PHP ActiveX
Python
PowerShell
Ruby
SQL Server
VBScript
Encrypt a File using 256-bit Rijndael (also known as AES)Download: Chilkat .NET Assemblies This is a much better C# File-to-File Encryption example Chilkat.Crypt2 c2 = new Chilkat.Crypt2(); c2.UnlockComponent("unlockCode"); // Set the encryption parameters. c2.CryptAlgorithm = "rijndael"; c2.KeyLength = 256; c2.SecretKey = c2.GenerateSecretKey("myPassword"); // The ReadFile and WriteFile methods are convenience methods // for reading/writing the contents of an entire file into a byte array. byte [] gifData = c2.ReadFile("dude.gif"); byte [] encryptedData = c2.EncryptBytes(gifData); c2.WriteFile("encrypted.dat",encryptedData); // Create a separate object for decryption Chilkat.Crypt2 c2a = new Chilkat.Crypt2(); // The parameters must match... c2a.CryptAlgorithm = "rijndael"; c2a.KeyLength = 256; c2a.SecretKey = c2.GenerateSecretKey("myPassword"); byte [] encryptedData2 = c2a.ReadFile("encrypted.dat"); byte [] gifData2 = c2a.DecryptBytes(encryptedData2); c2a.WriteFile("dude2.gif",gifData2);
|
© 2000-2012 Chilkat Software, Inc. All Rights Reserved.