finally AES.Free; end; end.
Public-key cryptography is a cornerstone of modern secure communication. TMSCP supports:
Delphi 10.2 Tokyo was a milestone release, particularly for its introduction of the . TMS Cryptography Pack 3.5.2.1 was optimized to ensure that the cryptographic logic remained consistent across Windows (32-bit and 64-bit), macOS, iOS, Android, and Linux. Example: Simple AES Encryption in Delphi
When choosing which version of the TMS Cryptography Pack to use, it is important to weigh performance against modern language features.
In Delphi 10.2 Tokyo, mobile platforms (iOS and Android) utilize the NextGen compiler, which features automatic reference counting (ARC) and 0-based string indexing. The TMS Cryptography Pack manages these differences internally, but developers must ensure they use TBytes or RawByteString rather than standard strings when handling raw cryptographic keys to avoid encoding corruption. 3. Upgrading to Modern Delphi (11 Alexandria / 12 Athens) tms cryptography pack 3521 delphi 102 tokyo and delphi
The native AES implementation can use the built-in AES-NI instructions in modern CPUs for superior performance. Conclusion
uses tmsCryptoCipher; function EncryptData(const APlaintext, AKey, AIV: string): string; var Cipher: TTMSCipher; begin Cipher := TTMSCipher.Create(nil); try Cipher.Algorithm := caAES256; Cipher.Mode := cmCBC; Cipher.KeyAsString := AKey; Cipher.IVAsString := AIV; Result := Cipher.EncryptStringToString(APlaintext); finally Cipher.Free; end; end; Use code with caution. Best Practices for Delphi Developers Using Cryptography
The general installation process via the TMS Smart Setup is straightforward. However, in some Delphi versions, users have encountered minor issues requiring manual intervention. For instance, in some cases, you might need to manually compile a project file (e.g., TMSCryptoPkgDEDXE14.dproj ) to ensure components appear in the Tool Palette. Another potential issue is encountering errors related to missing compiler executables (like dccaarm.exe ) if your Delphi installation does not include support for Android. As TMS support notes, if you are not targeting Android, you can safely ignore these errors, but they may prevent the installation process from completing automatically.
Open Delphi 10.2 Tokyo, navigate to Tools > Options > Environment Options > Delphi Options > Library , and add the source folder path to the "Library path" for both 32-bit and 64-bit Windows platforms. finally AES
The version specifically refined the integration for the Delphi 10.2 Tokyo environment, ensuring that developers could leverage the "Godzilla" release's improved 64-bit compiler performance and Linux support (via FireMonkey) while maintaining rock-solid security. Core Features of Version 3.5.2.1 1. Symmetric and Asymmetric Encryption The pack provides a comprehensive suite of algorithms:
uses System.SysUtils, TMS.Crypto.Cipher.Symmetric, TMS.Crypto.Hash;
AES (Advanced Encryption Standard) in CBC, CTR, and GCM modes; ChaCha20.
Enables two parties to establish a shared secret over an insecure channel without prior knowledge of each other. Integrating with Delphi 10.2 Tokyo TMS Cryptography Pack 3
For the latest updates, bug fixes (such as those for the X509 class), and enhanced key generation tools, ensure you are using the latest version of the pack.
, offering a suite of modern algorithms to encrypt, sign, and hash data across multiple platforms. What’s New in 3.5.2.1?
// Set the data to encrypt Data := TBytes.Create(1, 2, 3, 4, 5);
Supports Windows (32/64-bit), macOS, iOS, and Android.
// Use the encrypted data // ...