Delphi Encryption Compendium (DEC) 5.2 for D2009 released


I’ve recently released an updated version of the Delphi Encryption Compendium (DEC) compatible with Delphi versions up to 2009. A code example of using it with Unicode strings is included in the library.

This libary was updated and released with permisson of the original author Hagen Reddman who developed the versions DEC 3 and DEC 5.1.

The Delphi Encryption Compendium supports several hashes, ciphers and text encodings and is imho one of the best libraries for strong cryptography in Delphi. And the best: It is free of charge!

It is available at Torry:

Thanks to Michael Puff (a.k.a. Luckie) for hosting the library on his server!

Due to the request here are the hashes for the file linked at Torry / Michael’s Server:


MD5: af599125809e4258597138a7c4496b80
RipeMD128: 9e2717abecbcd20623ebb05a04a70143
RipeMD160: fe25c2d89c2487412c4c7b9d04a2f4a9eaf792df
SHA1: cda26284cd4099a30bd7c32e2076bac0cd1b9f32
SHA256: cdec0862005a6da637d3f7d9277d2cb65f0c3eb58f5a02866989e9b56879f999

Converting to D2009: How to keep PNGs in TImage


if you have been using Gustavo Daud’s PNGImage before and consider migrating existing projects to D2009 you must keep in mind that you will loose all previously assigned PNGs in your TImages.

As you all know Delphi 2009 ships with native PNG support but there are some differences. In PngImage.pas CodeGear declared

  TPNGObject = TPngImage deprecated 'Use TPngImage.';

So the classname for PNGs changed and the old one is marked as deprecated.

The problem: All TImage pictures are stored within the form’s .DFM file. Before inserting the binary data the IDE stores the classname (and it’s length) as a prefix to the data.

When using Gustavo’s component in D2006 it will store 0A54504E474F626A656374 which is in ASCII TPNGObject (the 1st 0A is the length of the following classname). In Delphi 2009 it stores 0954506E67496D616765 which is in ASCII TPngImage (again 09 is the length).

So when opening an existing form in D2009 the IDE searches for TPNGObject classname and as it cannot find it anymore the images are emptied.

With the help of Andreas Hausladen I came up with a solution for this:


  Classes, Graphics, PngImage;

  TPngObject = class(TPngImage);


  TPicture.RegisterFileFormat('PNG', 'Portable Network Graphics (Compatibility Wrapper)', TPngObject);

After discussing the issue Uwe Raabe yesterday published a fix inside of the PngComponents for Delphi 2009.

He used:

  TPNGObject = class(TPngImage);

  TPicture.RegisterFileFormat('', '', TPNGObject);

The empty strings will help to hide the wrapper from the FileOpen Dialog within the filter selection in the IDE.

An updated version if his port of the PngComponents for D2009 is available at CG:
PngComponents for Delphi 2009

Btw: The PngComponents Uwe published is still compatible with older Delphi Versions (tested with Delphi 2006). Only the PngImage Gustavo previously released on SourceForge is not available anymore as the license has been revoked as D2009 now ships with an enhanced version of it.