![]() |
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
(PowerBuilder) Transition from RandomizeKey to GenRandomBytesENCProvides instructions for replacing deprecated RandomizeKey method calls with GenRandomBytesENC. Note: This example requires Chilkat v11.0.0 or greater.
integer li_rc oleobject loo_Crypt string ls_RandomKeyBase64 loo_Crypt = create oleobject li_rc = loo_Crypt.ConnectToNewObject("Chilkat.Crypt2") if li_rc < 0 then destroy loo_Crypt MessageBox("Error","Connecting to COM object failed") return end if loo_Crypt.CryptAlgorithm = "aes" loo_Crypt.CipherMode = "cbc" loo_Crypt.KeyLength = 256 // ... // ------------------------------------------------------------------------ // The RandomizeKey method is deprecated: // Generates and sets a random 32-byte (256-bit) secret key. loo_Crypt.RandomizeKey() // ------------------------------------------------------------------------ // Do the equivalent using GenRandomBytesENC followed by SetEncodedKey loo_Crypt.EncodingMode = "base64" ls_RandomKeyBase64 = loo_Crypt.GenRandomBytesENC(32) loo_Crypt.SetEncodedKey(ls_RandomKeyBase64,"base64") destroy loo_Crypt |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.