Note: This page and the original code for DCPcrypt hasn't seen much attention in quite a while and is unlikely to for the foreseeable future. All the updates below are contributed by others.
A further update for Delphi XE (21-07-2012):
I have updated DCPCrypt (version dcpcrypt_2.0.4.1_xe2.zip) with the following changes: 1) The same code now compiles and works under Delphi XE2 (32 and 64 bit), Delphi 2009 and Delphi 5, and presumably under other versions between Delphi 5 and 2007. It used JEDI.INC (from Jedi Code Library) to distinguish between compiler versions. 2) SelfTest.dpr can be used to run SelfTest on all available algorithms. Also works in all Delphi versions listed above. The archive is here: http://www.pepak.net/files/tools/dcpcrypt.zip Thanks for the library! Pepak
A local copy of the code is available in case the above link dies: dcpcrypt2-xe-update2.zip
Update for Delphi XE (29-11-2011): From https://forums.embarcadero.com/thread.jspa?messageID=417095#417095
Hi, I needed to use DCPCrypt under Delphi XE2/dcc64 but currently there is no available version of this library which officially supports a such build configuration. The latest version of DCPCrypt for Delphi is v2 beta 3 with Unicode fixes, updated by Henri Gourvest and available here: http://www.cityinthesky.co.uk/opensource/dcpcrypt So I merged my original code with the Lazarus version that was already adapted for the FPC 64 bit compiler some years ago, and modified the code to allow the compilation under dcc64. The library seems to work under Win64 - at least all the internal tests succeeds. But from my POV it really deserves external code review and additional testing. So if you're a DCPCrypt user who plan to use the library under XE2 to produce 64 bit apps, could you take the time to check if all works fine on your side too ? Link to the updated library : http://reisubar.net/dcpcrypt/DCPCrypt_2.0.4.1_XE2.zip BTW, I also fixed a bug in TDCP_customice.InitIce(), where the "kb" array was accessed outside of its bound (the AV was only raised under Win64). Thanks for your feedback ! Adrien
A local copy of the code is available in case the above link dies: dcpcrypt_2.0.4.1_xe2.zip
Bug in RC4 implementation: Ray Marron has reported a bug in the RC4 implementation in DCPcrypt that means that when encrypting data sets over 8192 bytes in size the results will non-standard.
Update for Delphi 2009/2010: thanks to Lorenzo Monti for providing updated string encryption routines to work with unicode strings.
Update for Delphi 2009: thanks to Henri Gourvest for providing an update to make this package work under Delphi 2009.
DCPcrypt is an open source library of cryptographic components (encryption algorithms and hash algorithms) for Borland Delphi and Kylix (it also works under some versions of C++ Builder). I haven't been able to update it for quite a long time now but it still works quite happily with Delphi 4, 5, 6, 7 and 2005 and Kylix 1 and 2 (it might work under Kylix 3, but I don't have a copy to try it out on). The current version (v2 beta 3) is considered to be stable and for all intents and purposes is the final release before I revamp everything.
Thanks to Manuel C. for making changes to the code to make this work under Delphi 2005!
For those of you using PHP, here is a little demo showing how to get PHP and Delphi encryption to work together.
The idea behind DCPcrypt is that it should be possible to “drop in” any algorithm implementation to replace another with minimum or no code changes. To aid in this goal all cryptographic components are descended from one of several base classes, TDCP_cipher for encryption algorithms and TDCP_hash for message digest algorithms.
DCPcrypt v2 contains full implementations of the following algorithms: Encryption Algorithms
| Encryption Algorithms | Hash Algorithms |
|---|---|
| Blowfish | Haval |
| Cast 128 | MD4 |
| Cast 256 | MD5 |
| DES, 3DES | RipeMD-128 |
| Ice, Thin Ice, Ice2 | RipeMD-160 |
| IDEA | SHA-1 |
| Mars | SHA-256, SHA-384, SHA-512 |
| Misty1 | Tiger |
| RC2, RC4, RC5, RC6 | |
| Rijndael (the AES) | |
| Serpent | |
| Tea | |
| Twofish |
DCPcrypt is open source software (released under the MIT license) and as such there is no charge for inclusion in other software.
You can make donations via Paypal to the Paypal address paypal@cityinthesky.co.uk or by clicking the Donate button.
Alternatively, if you can buy me a gift from my wish list at Amazon.co.uk. Thanks!
If for some strange reason you'd like to contact me, try emailing me at davebarton@cityinthesky.co.uk.
Make sure the subject line is something noticeable e.g. “DCPcrypt”. If you don't get a reply within a week or two then try sending your message again.