Crypto for Android

Delphi and C++Builder cryptography library for Android.
  • utilizes Android Cryptography APIs
  • compatible with Delphi/C++Builder 10.4 to 12
  • source code included with the registered version
  • royalty-free distribution in applications

Note: The Crypto library code does not include any cryptographic algorithm implementations.

Order Crypto for Android license $160 USD (license for one developer)
Order Crypto for Android multi-license $480 USD (license for all developers in the company)
Order Crypto for Android year upgrades license $80 USD (registered users only)
Order Crypto for Android year upgrades multi-license $240 USD (registered multi-license users only)

FAQ

How can I use AES encryption and decryption?
const Cipher = CreateCipher(TCipherAlgorithm.AES, TCipherAlgorithmMode.CBC, TCipherAlgorithmPadding.PKCS5);
const SecretKey = CreateSecretKey('AES', TBytes.Create($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $A, $B, $C, $D, $E, $F));
const InitializationVector = TBytes.Create($F, $E, $D, $C, $B, $A, $9, $8, $7, $6, $5, $4, $3, $2, $1, $0);

// AES encryption
Cipher.Initialize(TCipherMode.Encrypt, SecretKey, CreateIvParameterSpec(InitializationVector));
var CipherText := Cipher.Final('Hello, world!');

// AES decryption
Cipher.Initialize(TCipherMode.Decrypt, SecretKey, CreateIvParameterSpec(InitializationVector));
const PlainBytes = Cipher.Final(CipherText);
const PlainText = TEncoding.UTF8.GetString(Cipher.PlainBytes);
ShowMessage(PlainText);
							
How can I encrypt and decrypt a file?
const Cipher = CreateCipher(TCipherAlgorithm.AES, TCipherAlgorithmMode.CBC, TCipherAlgorithmPadding.PKCS5);
const SecretKey = CreateSecretKey('AES', TBytes.Create($0, $1, $2, $3, $4, $5, $6, $7, $8, $9, $A, $B, $C, $D, $E, $F));
const InitializationVector = TBytes.Create($F, $E, $D, $C, $B, $A, $9, $8, $7, $6, $5, $4, $3, $2, $1, $0);

const Path = TPath.GetSharedDocumentsPath;

// encryption
Cipher.Encrypt(TPath.Combine(Path, 'plaintext.txt'), TPath.Combine(Path, 'encrypted.bin'), SecretKey, InitializationVector);

// decryption
Cipher.Decrypt(TPath.Combine(Path, 'encrypted.bin'), TPath.Combine(Path, 'decrypted.txt'), SecretKey, InitializationVector);