ImageEn, unit imageenproc |
|
TImageEnProc.Encrypt
Declaration
procedure Encrypt(const Passkey: AnsiString; Algorithm: TIEEncryptionAlgorithm = ieeaTEA);
procedure Encrypt(Passkey: array of byte; Algorithm: TIEEncryptionAlgorithm = ieeaTEA);
Description
Encrypts the current image (layer) using the Tiny Encryption Algorithm with a key of 128 bits:
en.wikipedia.org/wiki/Tiny_Encryption_Algorithm Parameter | Description |
PassKey | You can specify a string password, which will be hashed to a 128 bits key, or an array of bytes (a binary key of 16 bytes) |
Algorithm | Either ieeaTEA or ieeaTEA2. We recommend using ieeaTEA2 for better encryption |
Warning: The image must be saved using a
lossless format and in full rgb color spaces (no palette). If you use a lossy format such as JPEG, or a limited color format, such as GIF, you will not be able to decrypt the image.
Note:
◼The image muse be decrypted using
Decrypt◼There is no way to know whether an image is encrypted, unless you insert special tags into the meta-data yourself, such as
PNG_TextKeys for PNG, or
EXIF or
IPTC for TIFF
◼ieeaTEA2 should be used for stronger encryption (use ieeaTEA only for legacy compatibility)
ImageEnView1.IO.LoadFromFile('input.jpg');
ImageEnView1.Proc.Encrypt('captiva', ieeaTEA2);
ImageEnView1.IO.SaveToFile('crypted.png'); // Saving to lossless format
| Demos\Other\Encrypt\Encrypt.dpr |