cryptocol: A Comprehensive Cryptography Library
Endianness Support
cryptocol is optimized for Little-endian architectures, as they are the most widely used in modern computing. For more detailed information regarding Endianness (Little-endian vs. Big-endian), please read more here.
Big-endian Compatibility Notice
Support for Big-endian architectures is currently experimental. We do not recommend using this crate on Big-endian systems for production or critical applications. Users choosing to do so assume full responsibility for any potential issues.
Roadmap for Version 1.0
The following features are planned for the cryptocol ecosystem.
- Completed: Implementation and documentation are at least 95% complete.
- In Progress: Implementation or documentation is below 95%, or work has not yet begun.
1. Small Numbers
Foundational types for Big Numbers and other cryptographic modules.
-
SmallUIntTrait: Core implementation for primitive unsigned data types. -- SmallUInt - Primitive Unions: Implementation of unions for primitive unsigned types. -- ShortUnion, IntUnion, LongUnion, LongerUnion, SizeUnion, SharedValues, and SharedArrays
2. Big Numbers
Essential for Asymmetric-Key Algorithms and high-precision calculations.
- Fixed-Size Big Unsigned Integers: Standard operations for large unsigned integers. -- BigUInt.
- Auxiliary Big Unsigned Integer Operations: Specialized operations including modular arithmetic and primality testing. -- BigUInt_More, BigUInt_Modular, BigUInt_Prime, and BigUInt_Panic_Free.
3. Hash Algorithms
3-1. Official SHA-series
- SHA-3 & Keccak: Supports 8/16/32/64-bit variants, including SHA3-224/256/384/512 and SHAKE 128/256. -- Keccak_Generic
- SHA-2 (512/t): Including 512/256 and 512/224 variants. -- SHA2_512_t_Generic
- SHA-2 (512-bit): SHA-512, SHA-384, and SHA-512/256. -- SHA2_512_Generic
- SHA-2 (256-bit): SHA-256 and SHA-224. -- SHA2_256_Generic
3-2. Educational Hash Algorithms (Insecure)
Warning: These are intended for educational purposes only and should not be used for securing sensitive data.
- SHA-1 & SHA-0: 160-bit hash algorithms. -- SHA1_Generic
- MD5: 128-bit hash algorithm. -- MD5_Generic
- MD4: 128-bit hash algorithm. -- MD4_Generic
4. Symmetric-Key Algorithms (Block Ciphers)
4-1. AES Finalists
- AES (Advanced Encryption Standard) & Rijndael: Full support for AES/Rijndael with various operation modes (ECB, CBC, PCBC, CFB, OFB, CTR) and padding schemes (PKCS#7, ISO 7816-4). -- Rijndael_Generic, ECB_PKCS7, ECB_ISO, CBC_PKCS7, CBC_ISO, PCBC_PKCS7, PCBC_ISO, CFB, OFB, and CTR.
4-2. Educational Block Ciphers (Insecure)
Warning: These are intended for educational purposes only and should not be used for securing sensitive data.
- DES (Data Encryption Standard): Standard DES implementation with multiple modes (ECB, CBC, PCBC, CFB, OFB, CTR) and padding options (PKCS#7, ISO 7816-4). -- DES_Generic, ECB_PKCS7, ECB_ISO, CBC_PKCS7, CBC_ISO, PCBC_PKCS7, PCBC_ISO, CFB, OFB, and CTR.
4-3. Combined Cipher Containers
- BigCryptor128: A tool for combining multiple symmetric algorithms (e.g., 2AES, 3AES) with multiple modes (ECB, CBC, PCBC, CFB, OFB, CTR) and padding options (PKCS#7, ISO 7816-4). -- BigCryptor128, ECB_PKCS7, ECB_ISO, CBC_PKCS7, CBC_ISO, PCBC_PKCS7, PCBC_ISO, CFB, OFB, and CTR.
Note: While supported, using native AES-256 or specific Rijndael variants is generally recommended over 2AES/3AES for better security and performance.
- BigCryptor64: A tool for combining multiple symmetric algorithms (e.g., 2DES, 3DES) with multiple modes (ECB, CBC, PCBC, CFB, OFB, CTR) and padding options (PKCS#7, ISO 7816-4). -- BigCryptor64, ECB_PKCS7, ECB_ISO, CBC_PKCS7, CBC_ISO, PCBC_PKCS7, PCBC_ISO, CFB, OFB, and CTR.
5. Pseudo-Random Number Generators (PRNG)
- Generic PRNG Framework: -- struct Random_Generic and trait Random_Engine
- Hash-based PRNGs: Engines leveraging Keccak, SHA-3, SHA-2, and others. -- Random_BIG_KECCAK_1024, Random_SHA3_512, Random_SHA2_512, Any_SHAKE_256, Any_SHAKE_128, Any_SHA3_512, Any_SHA3_256, Any_SHA2_512, Any_SHA2_256, Slapdash_SHA1, Slapdash_SHA0, Slapdash_MD5, and Slapdash_MD4.
- Cipher-based PRNGs: Engines leveraging Rijndael and DES. -- Random_Rijndael, Any_Rijndael, and Slapdash_DES.
- Simple PRNGs: Basic randomization algorithms like Slapdash_Num_C.
6. Asymmetric-Key Algorithms
- ECC (Elliptic Curve Cryptography): (Planned) Generic ECC implementation with padding support. --
ECC_Generic. ECC (Elliptic Curve Cryptosystem) asymmetric-key encryption/decryption algorithm, and the traits and its implementations of Padding bits for ECC_Generic --- Includes ECC and its expanded versions. - RSA (Ron Rivest, Adi Shamir, Leonard Adleman): (In Progress) Implementation of RSA with PKCS #1 v1.5 and OAEP (Optimal Asymmetric Encryption Padding) (PKCS #1 v2.0/RFC 2437) padding. -- RSA_Generic, PKCS1V15, and OAEP.
Versioning Policy
The project will reach Version 1.0.0.0 once all twenty-one functional areas listed above are fully implemented.
- Pre-v1.0: Versions will range up to 0.21.x.x based on the progress of the listed functionalities.
- Post-v1.0: New features will increment the version beyond 1.0.0.0.
Note: Version numbers like 0.5.0.0 indicate progress through the functionality list, not necessarily a 50% completion of the entire codebase.
Breaking Changes
Please refer to BreakingChanges.md for a detailed history of API changes.