Chilkat HOME ASP Visual Basic VB.NET C# Visual C++ C MFC Delphi FoxPro Java Perl PHP Python Ruby SQL Server VBScript
|
Decrypt 256-bit AES with Prepended IV
Decrypt a 256-bit AES encrypted string (hex-encoded) such that the IV is prepended. The IV is 128-bits, which is equal to the block size of the encryption algorithm. Dim crypt As New ChilkatCrypt2 Dim success As Long success = crypt.UnlockComponent("Anything for 30-day trial") If (success <> 1) Then MsgBox "Crypt component unlock failed" Exit Sub End If crypt.CryptAlgorithm = "aes" crypt.CipherMode = "cbc" crypt.KeyLength = 256 Dim hexKey As String hexKey = "0000000000000000000000000000000000000000000000000000000000000000" crypt.SetEncodedKey hexKey,"hex" crypt.EncodingMode = "hex" Dim encWithIV As String encWithIV = "8F7D7B6BE90AE2027C6AB5397F674CA35ACC5FD4DE11382C7427CEE51006FDBBEBC9DD233AF62D6D30AF4C696088E905D16214FA2421BF16DF07658BD23B868D" Dim iv As String Dim encryptedText As String ' iv = Left$(encWithIV,32) encryptedText = Mid$(encWithIV,33) crypt.SetEncodedIV iv,"hex" Dim decText As String decText = crypt.DecryptStringENC(encryptedText) Text1.Text = Text1.Text & encWithIV & vbCrLf Text1.Refresh Text1.Text = Text1.Text & iv & vbCrLf Text1.Refresh Text1.Text = Text1.Text & encryptedText & vbCrLf Text1.Refresh Text1.Text = Text1.Text & decText & vbCrLf Text1.Refresh |
Need a specific example? Send a request to support@chilkatsoft.com
© 2000-2008 Chilkat Software, Inc. All Rights Reserved.