Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

PowerBuilder Examples

Web API Categories

ASN.1
Amazon Glacier
Amazon S3
Amazon S3 (new)
Amazon SES
Amazon SNS
Amazon SQS
Async
Azure Cloud Storage
Azure Service Bus
Base64
Bounced Email
Box
CAdES
CSR
CSV
Certificates
Compression
DKIM / DomainKey
DSA
Diffie-Hellman
Digital Signatures
Dropbox
Dynamics CRM
ECC
Email Object
Encryption
FTP
FileAccess
Firebase
GMail REST API
Geolocation
Google APIs
Google Calendar
Google Cloud Storage
Google Drive
Google Photos
Google Sheets
Google Tasks
Gzip
HTML-to-XML/Text

HTTP
HTTP Misc
IMAP
JSON
JSON Web Encryption (JWE)
JSON Web Signatures (JWS)
JSON Web Token (JWT)
Java KeyStore (JKS)
MHT / HTML Email
MIME
Microsoft Graph
NTLM
OAuth1
OAuth2
OneDrive
OpenSSL
Outlook
PEM
PFX/P12
POP3
PRNG
REST
REST Misc
RSA
SCP
SFTP
SMTP
SSH
SSH Key
SSH Tunnel
SharePoint
Socket/SSL/TLS
Spider
Stream
Tar Archive
Upload
WebSocket
XAdES
XML
XML Digital Signatures
XMP
Zip
curl

 

 

 

(PowerBuilder) Match MySQL AES_ENCRYPT Function

Demonstrates how to use the MySqlAesEncrypt and MySqlAesDecrypt methods to match MySQL's AES_ENCRYPT and AES_DECRYPT functions.

Here are MySQL AES_ENCRYPT test vectors:

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','password'))
Output:
CC5FDDF621AE2F48241BB80EDF2422949526FBAAA74885ACB020A74CAAB98BCFA1DD12E5D4C7922A2F9205D367921D9B

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','a'))
Output:
47A7E5FB591AD818BA3C9025D040514696BF50C2EFB0A453730E23E824F5F0357F3F673FCF0A7BD16465E82F937ED365

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','1234567890123456'))
Output:
D70F1A158553B721C5DB9220A627E7B17BFF78FF7A72C4AB565AC903A94DF76DB75A30583D4ED01E265147D5A9B04EC3

HEX(AES_ENCRYPT('The quick brown fox jumps over the lazy dog','abcdefghijklmnopqrstuvwxyz'))
Output:
425F259AD4C3DD0B37831C8F24507D7E1F056437C0D50D3C18FB6F600FC941A8D871E7DD7BCBEE4CA4698F074C135275

Chilkat ActiveX Downloads

ActiveX for 32-bit and 64-bit Windows

integer li_rc
oleobject loo_Crypt
string ls_ClearText
string ls_Password
string ls_HexEncryptedStr
string ls_DecryptedStr

// This example assumes the Chilkat API to have been previously unlocked.
// See Global Unlock Sample for sample code.

loo_Crypt = create oleobject
li_rc = loo_Crypt.ConnectToNewObject("Chilkat_9_5_0.Crypt2")
if li_rc < 0 then
    destroy loo_Crypt
    MessageBox("Error","Connecting to COM object failed")
    return
end if

ls_ClearText = "The quick brown fox jumps over the lazy dog"

ls_Password = "password"
ls_HexEncryptedStr = loo_Crypt.MySqlAesEncrypt(ls_ClearText,ls_Password)
Write-Debug ls_HexEncryptedStr
ls_DecryptedStr = loo_Crypt.MySqlAesDecrypt(ls_HexEncryptedStr,ls_Password)
Write-Debug ls_DecryptedStr

ls_Password = "a"
ls_HexEncryptedStr = loo_Crypt.MySqlAesEncrypt(ls_ClearText,ls_Password)
Write-Debug ls_HexEncryptedStr
ls_DecryptedStr = loo_Crypt.MySqlAesDecrypt(ls_HexEncryptedStr,ls_Password)
Write-Debug ls_DecryptedStr

ls_Password = "1234567890123456"
ls_HexEncryptedStr = loo_Crypt.MySqlAesEncrypt(ls_ClearText,ls_Password)
Write-Debug ls_HexEncryptedStr
ls_DecryptedStr = loo_Crypt.MySqlAesDecrypt(ls_HexEncryptedStr,ls_Password)
Write-Debug ls_DecryptedStr

ls_Password = "abcdefghijklmnopqrstuvwxyz"
ls_HexEncryptedStr = loo_Crypt.MySqlAesEncrypt(ls_ClearText,ls_Password)
Write-Debug ls_HexEncryptedStr
ls_DecryptedStr = loo_Crypt.MySqlAesDecrypt(ls_HexEncryptedStr,ls_Password)
Write-Debug ls_DecryptedStr


destroy loo_Crypt

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.