Skip to main content

Module replay_cache

Module replay_cache 

Source
Expand description

Replay Cache for Enhanced Replay Attack Protection

This module implements a TTL-based cache to track seen nonces and timestamps per peer, providing stronger protection against replay attacks beyond the basic timestamp window validation.

The cache automatically expires entries to prevent unbounded growth while maintaining security guarantees.

Structsยง

CacheKey
Key for cache entries - combines peer identifier with nonce
CacheStats
Statistics about the replay cache
ReplayCache
TTL-based replay cache with automatic expiration and O(1) eviction