![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
AES String EncryptionAES string encryption in ASP.
<html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> </head> <body> <% set crypt = Server.CreateObject("Chilkat_9_5_0.Crypt2") success = crypt.UnlockComponent("Anything for 30-day trial") If (success <> 1) Then Response.Write "<pre>" & Server.HTMLEncode("Crypt component unlock failed") & "</pre>" End If 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. hexKey = crypt.GenEncodedSecretKey(password,"hex") crypt.SetEncodedKey hexKey,"hex" crypt.EncodingMode = "base64" 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. encText = crypt.EncryptStringENC(text) Response.Write "<pre>" & Server.HTMLEncode( encText) & "</pre>" ' Decrypt and show the original string: decryptedText = crypt.DecryptStringENC(encText) Response.Write "<pre>" & Server.HTMLEncode( decryptedText) & "</pre>" %> </body> </html> |
||||
© 2000-2026 Chilkat Software, Inc. All Rights Reserved.