Chilkat HOME Android™ ASP Visual Basic VB.NET C# iOS (IPhone) Objective-C C++ C Unicode C++ Unicode C MFC Delphi DLL Delphi ActiveX FoxPro Java Perl PHP Extension PHP ActiveX Python PowerShell Ruby SQL Server VBScript
AES String EncryptionAES string encryption in C#. Download: Chilkat .NET Assemblies Chilkat.Crypt2 crypt = new Chilkat.Crypt2(); bool success; success = crypt.UnlockComponent("Anything for 30-day trial"); if (success != true) { MessageBox.Show("Crypt component unlock failed"); return; } string password; password = "secretPassPhrase"; crypt.CryptAlgorithm = "aes"; crypt.CipherMode = "cbc"; crypt.KeyLength = 128; // Generate a binary secret key from a password string // of any length. For 128-bit encryption, GenEncodedSecretKey // generates the MD5 hash of the password and returns it // in the encoded form requested. The 2nd param can be // "hex", "base64", "url", "quoted-printable", etc. string hexKey; hexKey = crypt.GenEncodedSecretKey(password,"hex"); crypt.SetEncodedKey(hexKey,"hex"); crypt.EncodingMode = "base64"; string text; text = "The quick brown fox jumped over the lazy dog."; // Encrypt a string and return the binary encrypted data // in a base-64 encoded string. string encText; encText = crypt.EncryptStringENC(text); textBox1.Text += encText + "\r\n"; // Decrypt and show the original string: string decryptedText; decryptedText = crypt.DecryptStringENC(encText); textBox1.Text += decryptedText + "\r\n"; |
© 2000-2013 Chilkat Software, Inc. All Rights Reserved.