Skip to main content

Crate shield_core

Crate shield_core 

Source
Expand description

§Shield Core

EXPTIME-secure encryption library - Rust implementation.

§Security Model

Shield uses only symmetric primitives with proven exponential-time security. Breaking requires 2^256 operations - no shortcut exists.

  • PBKDF2-SHA256 for key derivation
  • AES-256-CTR-like stream cipher (SHA256-based keystream)
  • HMAC-SHA256 for authentication

§Usage

use shield_core::Shield;

let shield = Shield::new("password", "service.com");
let ciphertext = shield.encrypt(b"secret data").unwrap();
let plaintext = shield.decrypt(&ciphertext).unwrap();

§Error Handling

All fallible operations return Result<T, ShieldError>. Common errors:

§Panics

Functions that may panic are documented, but panics are rare and indicate:

  • Internal invariant violations (should never happen in correct usage)
  • System-level failures (e.g., time going backwards)

Re-exports§

pub use channel::ChannelConfig;
pub use channel::ShieldChannel;
pub use channel::ShieldListener;
pub use fingerprint::FingerprintMode;

Modules§

channel
Shield Secure Channel - TLS/SSH-like secure transport using symmetric crypto.
fingerprint
Hardware fingerprinting for device-bound encryption.
password
Password strength analysis and validation.

Structs§

BroadcastEncryption
Efficient broadcast encryption for large groups.
EncryptedBroadcast
Encrypted broadcast message format.
EncryptedGroupMessage
Encrypted group message format.
GroupEncryption
Multi-recipient encryption.
Identity
User identity.
IdentityProvider
Identity provider for managing users and sessions.
KeyRotationManager
Key rotation manager.
KeySplitter
Split keys into shares (all required to reconstruct).
LamportSignature
Lamport one-time signature (post-quantum secure).
PAKEExchange
Password-Authenticated Key Exchange.
QRExchange
Key exchange via QR codes or manual transfer.
RatchetSession
Ratcheting session for forward secrecy.
RecoveryCodes
Recovery codes for 2FA backup.
SecureSession
Secure session with automatic key rotation.
Session
Session information.
Shield
EXPTIME-secure symmetric encryption.
StreamCipher
Stream cipher for large file encryption.
SymmetricSignature
HMAC-based symmetric signature.
TOTP
TOTP generator and validator.

Enums§

ShieldError
Errors that can occur during Shield operations.

Functions§

quick_decrypt
Quick decrypt with pre-shared key
quick_encrypt
Quick encrypt with pre-shared key (no password derivation)

Type Aliases§

Result
Result type for Shield operations.