DCPcrypt Cryptographic Component Library v2
Copyright © 1999-2002 David Barton
http://www.cityinthesky.co.uk/
crypto@cityinthesky.co.uk
Introduction
DCPcrypt is a collection of cryptographic components for the Borland Delphi(tm), C++ Builder(tm) and Kylix(tm) programming languages. The supported versions are Delphi 4, 5 and 6, C++ Builder (3?), 4, 5, 6 and Kylix 1 (untested) and 2.
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 is open source software (released under the MIT license) and as such there is no charge for inclusion in other software. However, I am currently a student and if you are making money from my software I would really appreciate a donation of some sort, whether financial or a license for the software you develop (or if anyone wants to sponsor a Mathematical Modelling (Masters) student for their final year...). Please note THIS IS NOT COMPULSORY IN ANY WAY. See http://www.cityinthesky.co.uk/cryptography.html for details on donations. This software is OSI Certified Open Source Software. OSI Certified is a certification mark of the Open Source Initiative. If you maintain a website then a link to my page at http://www.cityinthesky.co.uk/ would be great! |
What's New
Changes since DCPcrypt v2 Beta 1:
Installation
Delphi | Open the appropriate package, DCPdelphiX.dpk where X is your version of Delphi (either 4, 5 or 6). Then press the install button. |
C++ Builder | Create a new design time package and add all the .pas files from the DCPcrypt2.zip archive including all those in the Ciphers and Hashes subdirectories. Then press the install button. |
Kylix | Open the DCPkylix.dpk package and then press the install button (note: Kylix 1 users may need to create a new package as with C++ Builder as this is a Kylix 2 package). |
You may need to add the directory containing DCPcrypt (and the Ciphers and Hashes subdirectories) to your library search path (found under Environment Options).
Once installed you will find two extra pages of components on your component palette, namely DCPciphers and DCPhashes. You can now place these components onto the form of your application to start using the algorithms.
Usage
Please note that an appreciation of the basic principles of encryption/decryption and key management is needed to ensure the correct usage of the ciphers implemented within this package. A good introduction on this subject is provided by Bruce Schneier's "Applied Cryptography" (ISBN: 0-471-11709-9) also see the NIST publication SP800-38A for information on the block cipher chaining modes.
DCPcrypt v2 contains the following ciphers and hash algorithms:
Ciphers | |||
Name | Patents | Block Size | Max Key Size* |
Blowfish | None | 64 bits | 448 bits |
Cast-128 | None | 64 bits | 128 bits |
Cast-256 | Patented? | 128 bits | 256 bits |
DES | None | 64 bits** | 64 bits |
3DES | None | 64 bits | 192 bits |
Ice | None? | 64 bits | 64 bits |
Thin Ice | None? | 64 bits | 64 bits |
Ice 2 | None? | 64 bits | 128 bits |
IDEA | Free for non-commercial use | 64 bits | 128 bits |
MARS | Patented? | 128 bits | 1248 bits |
Misty1 | Free for non-commercial use | 64 bits | 128 bits |
RC2 | None | 64 bits | 1024 bits |
RC4 | None | N/A | 2048 bits |
RC5 | Patented | 64 bits | 2048 bits |
RC6 | Patented | 128 bits | 2048 bits |
Rijndael (AES) | None | 128 bits | 256 bits |
Serpent | None | 128 bits | 256 bits |
TEA | None | 64 bits | 128 bits |
Twofish | None | 128 bits | 256 bits |
* although the quoted maximum key size may extremely large it doen't mean that the algorithm is secure to the same level.
** a 64bit key is used for DES then every 8th bit is discarded (parity) so the effective size is 56 bits.
Hash Algorithms | ||
Name | Patents | Digest Size |
Haval | None | 128, 160, 192, 224, 256 bits* |
MD4 | None | 128 bits |
MD5 | None | 128 bits |
RipeMD-128 | None | 128 bits |
RipeMD-160 | None | 160 bits |
SHA-1 | None | 160 bits |
SHA-256 | None | 256 bits |
SHA-384 | None | 384 bits |
SHA-512 | None | 512 bits |
Tiger | None | 192 bits |
* The different digest sizes of Haval can be accessed by uncommenting the $defines at the start of DCPhaval.pas.
Contact
I appreciate knowing what DCPcrypt is being used for and also if you have any queries or bug reports please email me at crypto@cityinthesky.co.uk.
DCPcrypt is copyrighted © 1999-2002 David Barton.
All trademarks are property of their respective owners.