Expand description
ยงKittyTLS Cryptographic Library
A comprehensive cryptographic library designed to provide first-class documentation, easy-to-use APIs, and wide deployment compatibility across different environments.
ยง๐ Quick Start
For most use cases, we recommend using the high-level envelope module, which provides
unified interfaces for common cryptographic operations:
use crown::envelope::*;
use crown::core::CoreWrite;
// Hash operations
let mut hasher = EvpHash::new_sha256()?;
hasher.write(b"hello world")?;
let digest = hasher.sum();
// AEAD encryption
let cipher = EvpAeadCipher::new_aes_gcm(&key)?;
cipher.seal_in_place_separate_tag(&mut data, &nonce, &[])?;ยง๐ Library Structure
envelope- High-level unified interfaces (recommended for most users)aead- Authenticated encryption with associated data implementationsblock- Low-level block cipher implementationsstream- Stream cipher implementationshash- Cryptographic hash functions (fixed and variable length)mac- Message authentication codesmodes- Cipher modes of operation for block cipherspadding- Padding schemes for block alignmentkdf- Key derivation functionspassword_hash- Specialized password hashing functions
ยง๐ Security Recommendations
Users should understand which algorithms are secure and which are not. For beginners, we recommend the following modern, secure algorithms:
- Encryption: Always use ChaCha20-Poly1305 or AES-GCM for authenticated encryption
- Hashing: Use SHA-256, SHA-3, or BLAKE2 for general purposes
- Password Hashing: Use Argon2, scrypt, or bcrypt for password storage
Avoid legacy algorithms like MD5, SHA-1, DES, and RC4 which are cryptographically broken.
ยงDesign Goals
- Ease of Use: Simple, intuitive APIs with comprehensive documentation
- Performance: Optimized implementations with platform-specific acceleration
- Security: Constant-time operations and secure defaults
- Compatibility: Support for
no_stdenvironments and various platforms
ยงFeature flags
std(enabled by default) โ Enable stdalloc(enabled by default) โ Enable alloccudaโ Enable Cuda. (Experimental)bindgenโ regenerate cuda sys.rsasmโ Enable asm support. (Experimental)unstableโ Enable experimental features
Re-exportsยง
pub use utils::rand;
Modulesยง
- aead
- Authenticated Encryption with Associated Data (AEAD)
- block
- Block Cipher Implementations
- core
- envelope
- High-Level Cryptographic Interface
- error
- hash
- Hash Function Implementations
- kdf
- Key Derivation Functions (KDF)
- mac
- Message Authentication Code (MAC)
- modes
- Cipher Modes of Operation
- padding
- Padding Schemes
- password_
hash - Password Hashing Functions
- stream
- Stream Cipher Implementations
- utils