Module forward_secure

Module forward_secure 

Source
Expand description

Forward-Secure Signatures for key evolution and retroactive security.

Forward-secure signatures ensure that even if the current secret key is compromised, signatures created in previous time periods remain secure and unforgeable.

§Use Cases in CHIE Protocol

  • Long-Running P2P Nodes: Protect historical bandwidth proofs even if current key leaks
  • Audit Trails: Ensure past signatures remain valid even after key compromise
  • Progressive Security: Periodically evolve keys to limit damage from future compromises

§Protocol

  1. Key Evolution: Secret key evolves through one-way function after each period
  2. Signature Generation: Sign with current period’s key
  3. Key Update: Securely delete old key after evolution
  4. Verification: Verify signature with public key and time period

§Security Guarantee

If an attacker obtains the secret key at period t, they cannot:

  • Forge signatures for periods < t (forward security)
  • They can forge for periods >= t (but this is unavoidable)

§Example

use chie_crypto::forward_secure::{ForwardSecureKeypair, ForwardSecureSignature};

// Generate keypair with max 100 time periods
let mut keypair = ForwardSecureKeypair::generate(100);
let public_key = keypair.public_key().clone();

// Sign message in period 0
let message = b"bandwidth proof at time 0";
let sig0 = keypair.sign(message).unwrap();
assert_eq!(sig0.period(), 0);

// Verify signature
assert!(sig0.verify(message, &public_key).is_ok());

// Evolve to next period (old key is securely deleted)
keypair.evolve().unwrap();

// Sign in period 1
let sig1 = keypair.sign(b"proof at time 1").unwrap();
assert_eq!(sig1.period(), 1);

// Old signature still verifies
assert!(sig0.verify(message, &public_key).is_ok());

// Cannot forge signatures for period 0 even with current key

Structs§

ForwardSecureBuilder
Builder for forward-secure keypair with configuration
ForwardSecureKeypair
Forward-secure signing keypair
ForwardSecurePublicKey
Forward-secure public key (remains constant across all periods)
ForwardSecureSignature
Forward-secure signature with embedded time period

Enums§

ForwardSecureError

Type Aliases§

ForwardSecureResult