![]() |
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
(DataFlex) Transition from RandomizeKey to GenRandomBytesENCProvides instructions for replacing deprecated RandomizeKey method calls with GenRandomBytesENC. Note: This example requires Chilkat v11.0.0 or greater.
Use ChilkatAx-win32.pkg Procedure Test Handle hoCrypt String sRandomKeyBase64 Get Create (RefClass(cComChilkatCrypt2)) To hoCrypt If (Not(IsComObjectCreated(hoCrypt))) Begin Send CreateComObject of hoCrypt End Set ComCryptAlgorithm Of hoCrypt To "aes" Set ComCipherMode Of hoCrypt To "cbc" Set ComKeyLength Of hoCrypt To 256 // ... // ------------------------------------------------------------------------ // The RandomizeKey method is deprecated: // Generates and sets a random 32-byte (256-bit) secret key. Send ComRandomizeKey To hoCrypt // ------------------------------------------------------------------------ // Do the equivalent using GenRandomBytesENC followed by SetEncodedKey Set ComEncodingMode Of hoCrypt To "base64" Get ComGenRandomBytesENC Of hoCrypt 32 To sRandomKeyBase64 Send ComSetEncodedKey To hoCrypt sRandomKeyBase64 "base64" End_Procedure |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.