Chilkat • HOME • Android™ • Classic ASP • C • C++ • C# • Mono C# • .NET Core C# • C# UWP/WinRT • DataFlex • Delphi ActiveX • Delphi DLL • Visual FoxPro • Java • Lianja • MFC • Objective-C • Perl • PHP ActiveX • PHP Extension • PowerBuilder • PowerShell • PureBasic • CkPython • Chilkat2-Python • Ruby • SQL Server • Swift 2 • Swift 3,4,5... • Tcl • Unicode C • Unicode C++ • Visual Basic 6.0 • VB.NET • VB.NET UWP/WinRT • VBScript • Xojo Plugin • Node.js • Excel • Go
(Excel) Simple AES ECB DecryptionSee more Encryption ExamplesDecrypt 256-bit encrypted content.
' This example assumes the Chilkat API to have been previously unlocked. ' See Global Unlock Sample for sample code. Dim crypt As Chilkat.Crypt2 Set crypt = Chilkat.NewCrypt2 ' Encrypted content (base64-encoded) ct = "d/95VziAnUNKkpXr3dJBFcQqAEDWlDkc7EU2jLkYPxmr6PpLRJlgHos+/Uy28CvJsmztQ3JkJAMukVoj46QJ/7RMuqLb31cSKd1ZvMzx9J9b6q0EkmPJcSfBhf2x7v5Qvq3lz1EIH7RM61cDGf+g9p4lt6FtU2MzCqtYD+Vr29voCn5WU1CnXmks64RrbyDA1DDHOx2deJ4Kn68+KoPM9tAw9kbf4HApL1nJYU3Mfzl+MnuHuB2kJpL5GqbuNvS+4QjxuwtNGuZEEY0gOS4RIvWl/XfkxtWHMkzsKy08AO792xDGer4rL4Q1NcfI/H2V" ' 256-bit AES key (literally the 32 us-ascii bytes of this string) key = "sQsPQYesBM5qEM5OSxicFatIiLM459Bu" ' Note: If your AES key is a string, and it's not clearly hex or base64, AND if the length of the string is the exact size of the AES key, ' then *literally* use the ascii chars as the AES key. crypt.CryptAlgorithm = "aes" crypt.CipherMode = "ecb" crypt.KeyLength = 256 ' use the exact ascii bytes as the key. crypt.SetEncodedKey key,"ascii" crypt.EncodingMode = "base64" pt = crypt.DecryptStringENC(ct) Debug.Print pt |
© 2000-2022 Chilkat Software, Inc. All Rights Reserved.