DCPcrypt v2.0.6 — Cryptographic Component Library for Free Pascal/Lazarus (MIT, pure Pascal, cross-platform)
Hey everyone,
I’m releasing DCPcrypt v2.0.6, a maintained continuation of David Barton’s original Delphi cryptographic library, fully ported to Lazarus/FPC and actively developed with new examples, tests, and documentation.
◈ What’s inside
• 20 cipher algorithms — Rijndael (AES), Blowfish, Twofish, Serpent, DES, 3DES, RC4, RC5, RC6, MARS, IDEA, Cast128, Cast256, Misty1, ICE, TEA, GOST…
• 10 hash algorithms — SHA-1, SHA-256, SHA-384, SHA-512, MD5, RIPEMD-128, RIPEMD-160, Tiger, HAVAL, MD4
• 6 block cipher modes — ECB, CBC, CFB8bit, CFBblock, OFB, CTR
• Stream encryption with Salt + IV + progress callbacks
• Base64 encoding/decoding
• Pure Pascal — no external C libraries, no DLLs
• Cross-platform — Linux, Windows, macOS
◈ Design philosophy
All ciphers derive from TDCP_cipher and all hashes from TDCP_hash. Algorithms are easily swappable with minimal code changes. InitStr accepts a passphrase and any hash class for key derivation, so moving from Rijndael+SHA256 to Twofish+SHA512 is typically a one-line change.
◈ Highlights (since the Lazarus port work)
• GUI examples ported from Delphi VCL to Lazarus LCL
– String encryption/decryption
– Threaded file encryption with progress bar
• Console demo programs
– String encryption (Salt + IV)
– File encryption with progress callback
– Large file hashing (>5 GB) with real-time progress, MB/s speed display, and elapsed time
• 282 automated functional tests covering hashes, ciphers, block modes, Base64, and stream encryption
• Makefile for command-line builds (tests, examples, full builds)
• GitHub Actions CI/CD pipeline building and testing on Linux, Windows, and macOS
• Full project documentation (README, building guide, contributing guide, API notes)
• Detailed comments across all source units
• Improved FPC compatibility
– Removed need for the -Mdelphi compiler flag
– Examples now use ObjFPC mode
– Added missing mode directives to core units
◈ Links
GitHub:
https://github.com/NDXDeveloper/dcpcrypt-lazarusRelease:
https://github.com/NDXDeveloper/dcpcrypt-lazarus/releases/tag/v2.0.6Docs:
https://github.com/NDXDeveloper/dcpcrypt-lazarus/tree/main/docsMIT licensed. Works with FPC 3.2.0+ and Lazarus 2.0+.
Feedback, testing, and contributions are very welcome!