Delphi Math Functions

Cryptography and Multiple-Precision Arithmetic


Multiple-Precision Arithmetic
Also see Cryptography section of efg's Mathematics Page

Federation of American Scientists:  Cryptology Links
Everything to hide:  Knowing the right cryptographic algorithm
Dr. Dobb's Security Page

Category Source(s)
Anti-Cracking FAQ from Richey's Delphi-Box 
ASCryptoKit5 Easy to use, fast and flexible components implementing most popular algorithms to encrypt/decrypt data and calculate digests. Package includes random and prime numbers generators up to 4096 bit. All cryptography components can generate keys, load and save them to file. All but RSA support ECB. CBC, CFB and OFB modes, ciphering in-place or into internal buffers.
Block Ciphers

A block cipher class hierarchy. Currently includes TDESCipher and TBlowfishCipher, with more to come soon. The ciphers all form a hierarchy, descending from TBlockCipher, allowing for polymorphic instantiation of any cipher you choose. The DES implementation has been heavily optimized with a lot of help from Bob Lee. It encrypts 4.2 megs/sec on my Pentium II. Blowfish has been similarly optimized, encrypting 6.5 megs/sec.

Crypt32 Delphi Super Page:
Cipher Compendium of various Hash-,Checksum- and Encryption algorithm, include:
Hash-Alogrithm: MD4, MD5, RipeMD160, SHA1, Haval (128-256)
Checksum-Algorithm: XOR16, XOR32, CRC32
Encryption-Algorithm: Gost, Cast128, Cast256, IDEA, Mars, Misty 1, RC2, RC4, RC5, RC6, FROG, SAFER-K40, SAFER-SK40, SAFER-K64, SAFER-SK64, SAFER-K128, SAFER-SK128, TEA, Skipjack, Rijndael, Blowfish.
Crypt100 This component enables you to store the text of any Control in an encrypted form in the program file so you can protect important information that is only available on runtime.
Crypt102 by Herzog Samuel. TDESCrypt component. Delphi Super Page:
CryptLib Several advanced encryption algorithms
Delphi Super Page:
CryptoAPI ProjectJediButton.gif (3350 bytes)
Project JEDI Conversion Library by Massimo Maria Ghisalberti 

Interface for Microsoft CryptoAPI version 1.1 

Bug-fixed: Interface for Microsoft CryptoAPI version 2.0 

See also WinCrypt

CryptoFile CryptoFile Ŕ una utilitÓ per la CryptoFile Ŕ una utilitÓ per la cifratura di file di qualunque tipo, possono essere scelti due tipi di cifratura e marchiare il file con il nome del proprietario.
Cryptography Links
Delphi Crypto Software Delphi AdvancedEncryption Components.
Crytpography and Encryption: WinPGP32: Secure Hash Algorithm, BlowFish Algorithm, Elliptic Curve Public Key Component, DES; Also, Delphi Crypto Graveyard.
Delphi Cryptography Page Binary compatible implementations of SkipJack,Blowfish, RC2, RC4, RC6 and MD5. Crypto Papers: Twofish, Serpant, RC4, RC5, RC6, MD5, Deal. 
Delphi Encryption Compendium A Compendium of various strong Encryption Algorithm and more... includes:
  • 40 Ciphers (IDEA, Blowfish, Twofish, DES, Square ...)
  • 23 Hashs (MD4/5, SHA/1, RipeMD, Havel, Tiger ...)
  • 5 Checksums (CRC32, CRC16-CCITT, CRC16-Standard ...)
  • 6 Textformats (MIME Base 64, XX/UU Coding, RFC1760 Six Word ...)
  • 2 Randoms (LFSR Linear Feedback Shift Register with variable Period upto 2^2032-1 ...)
  • with Ciphers can be encrypt in Modes CTS/ CBC/ CFB/ OFB/ ECB
  • Ciphers supports Message Authentication Codes in CBC-MAC/ CFB-MAC/ CTS-MAC
  • fast Implementation (i.e. Blowfish > 8Mb/sec, MD4 > 27Mb/sec) Internet RFC2289/RFC1760/RFC2444 One Time Password Routines as Component

Delphi Pages Encryption
Search Delphi Pages
DES DataEncryptionStandard.pas, which contains TDESCipher, an implementation of the 56-bit Data Encryption Standard block cipher. Also includes an example project.   Optimized with much help from Bob Lee.  Encrypts 4.2 megabytes/sec on a P2.

DES encryption/decryption component.

Encrypt Component to code/decode text in a string.  Delphi Super Page:
Encryption in Delphi  (Revisited)
EncryptMsg, DecryptMsg In Chapter 21, pp. 347-349, How to Program Delphi 3
gbcrypt Simple and very fast Encrypt/Decrypt component working on  registers with a 64 bits key.  Delphi Super Page:
How to encrypt a String D3/D4 version using TSecurity class
efg's  SimpleSecurity.ZIP project
Image Encryption CryptImage.jpg (868 bytes)  Image Encryption:  BMPs and JPEGs

See Andreas Filsinger's original  summary of this encryption method and an updated version for Delphi 6.01.

MD5 Algorithm Steve Shafer's UseNet Post with Delphi unit
Message Digests A collection of classes for creating message digests, including MD2, MD4, MD5, SHA-1, and RIPEMD-160. Also includes a class for making secure hashes (HMACs) out of these digests. The hierarchy works out real neat, so they all have a consistent interfaces, and a cute little virtual constructor mechanism for creating the HMACs class. 
Microsoft CryptoAPI For Your Eyes Only -- Working with the Microsoft CryptoAPI
Delphi Informant
, Feb. 1999, pp. 52-60.  (link broken 8 Oct 2000)
Misty1 A binary compatible implementation of the Misty1 encryption  algorithm.  Delphi Super Page:
PGP Pretty Good Privacy:  Implementing Secure Messaging with PGP, Delphi Informant 
R2, R4, R5, R6 Block encryption algorithms by David Barton
Shipjack Shipjack block encryption algorithm by David Barton
Software protection Software protection based on hardware serial numbers that  are being crypted using MD5 and converted to license and  serial registration numbers.   Delphi Super Page:
Steganography Hiding in plain view:  The little-known technique of steganography provides a stealthy way to conceal data in other text.,1410,20586,00.html 
SWAG Encryption SWAG (Software Archive Group).    (requires Reader)
TBlowfish Delphi implementation of the popular and fast 'Blowfish' algorithm. Blowfish is royalty free and does not have   any known weaknesses, and can support a key length of up to 448   bits.   Delphi Super Page:
TDESCrypt component See the Delphi Studio Companion CD #1  
TEncrypt Cross-compilable source for Encryption/Decryption component
TMxCrypto Allows you to encrypt/decrypt a file with 2 key encryption.
Torry's Security Links 

WinCrypt See also CryptoAPI

Delphi Super Page:

Bernd Lehmann's Example Project using WinCrypt

Multiple-Precision Arithmetic

Numerical Methods in Pascal page

Arbitrary precision computation 

Description Source(s)
"Big" Factorials "Big Factorials" program
Big_Number Page Non-Delphi:  Ada
BNC High-precision (151 digits) floating  point calculator.
GMP 2.0.2: Pascal header for the GNU Multi-Precision Library

GNU Multi-Precision (GMP) Info:

GNU MP page:

Huge Integer Tools (HIT) Marcel Martin's HIT (Huge Integer Tools) is a high-performance set of multi-precision arithmetic tools for Delphi 4  and above. With HIT, you can efficiently and easily program algorithms that require very big integers (or polynomials over GF(2)). HIT was designed to be as fast as possible. The speed is achieved by using fast algorithms and by using optimized assembly code for basic operations

HIT (Huge Integer Tools) is a set of multi-precision arithmetic tools. With HIT you can efficiently implement algorithms that require very big integers or polynomials over GF(2): Primality Testing, Factorization, Public Key Cryptography, etc. (ver. 1.02, HIT is FREE for personal, educational, or any non-commercial  use) 

HugeInt Huge integer arithmetics. Unsigned integers repesented as string.   As many digits as memory can accept. (ver. 1.0, Demo projects attached. Example prime number search.)
Huge numbers Unofficial Delphi Developers FAQ:
Section 37, Item 1
LongCalc RPN expression evaluation with vast integers
PassCryp.    Simple component which implements Crypto API function to   generate a hash of a string. Good for storing password information in encrypted form inside tables.
SysTools: BCD High Precision Math

Links Verified 8 Oct 2000
Updated 28 Nov 2002

since 1 Nov 1998