Crate cargocrypt

Crate cargocrypt 

Source
Expand description

§CargoCrypt - Zero-config cryptographic operations for Rust projects

CargoCrypt provides enterprise-grade cryptography with zero configuration required. It follows the Rust ecosystem’s convention-over-configuration philosophy, similar to successful tools like cargo-audit and ripgrep.

§Quick Start

use cargocrypt::{CargoCrypt, CryptoConfig};

#[tokio::main]
async fn main() -> anyhow::Result<()> {
    // Zero-config initialization
    let crypt = CargoCrypt::new().await?;
     
    // Encrypt a file
    crypt.encrypt_file("src/secrets.rs").await?;
     
    // Decrypt when needed
    crypt.decrypt_file("src/secrets.rs.enc").await?;
     
    Ok(())
}

Re-exports§

pub use crate::core::CargoCrypt;
pub use crate::core::CargoCryptBuilder;
pub use crate::core::CryptoConfig;
pub use crate::core::SecretBytes;
pub use crate::core::ResilienceManager;
pub use crate::core::ResilienceConfig;
pub use crate::crypto::CryptoEngine;
pub use crate::crypto::DerivedKey;
pub use crate::crypto::EncryptedSecret;
pub use crate::crypto::PlaintextSecret;
pub use crate::crypto::SecretMetadata;
pub use crate::crypto::SecretType as CryptoSecretType;
pub use crate::crypto::PerformanceProfile;
pub use crate::crypto::EncryptionOptions;
pub use crate::crypto::CryptoError;
pub use crate::crypto::CryptoResult as CryptoCoreResult;
pub use crate::error::CargoCryptError;
pub use crate::error::ErrorKind;
pub use crate::error::CryptoResult;
pub use crate::detection::SecretDetector;
pub use crate::detection::ScanOptions;
pub use crate::detection::DetectionConfig;
pub use crate::detection::Finding;
pub use crate::detection::FoundSecret;
pub use crate::detection::SecretType as DetectionSecretType;
pub use crate::detection::PatternMatch;
pub use crate::detection::EntropyResult;
pub use crate::detection::CustomRule;
pub use crate::detection::RuleEngine;

Modules§

core
Core CargoCrypt functionality - CLEAN VERSION
crypto
Cryptographic operations module
detection
Secret Detection Module
error
Error types for CargoCrypt
git
Git-native integration for CargoCrypt
monitoring
Monitoring, logging, and telemetry module
resilience
Resilience and graceful degradation module
tui
tui_simple
Simplified TUI implementation for CargoCrypt file browser
utils
Utility functions for common operations
validation
Input validation and sanitization module

Macros§

trace_operation
Helper macro to trace function execution
with_circuit_breaker
Helper macro to execute operations with circuit breaker protection
with_error_recovery
Helper macro to execute operations with error recovery

Functions§

decrypt
Quick decrypt function for simple use cases
default_config
Default configuration that works for most use cases
encrypt
Quick encrypt function for simple use cases
init
Initialize CargoCrypt in the current directory