This repository contains implementations of various coding patterns with a focus on security and attack-defense strategies. The project demonstrates secure implementations of algorithms and data structures while showing how they can be attacked and defended against.
two-pointer-project: Main implementation of two-pointer algorithms with security considerationstwo-pointer-5-types: Documentation and specialized implementations of 5 types of two-pointer patternsfast-n-slow-pointer: Fast and slow pointer patterns (currently empty)
- Opposite-Ends (Converging)
- Same-Direction (Fast/Slow; "Tortoise–Hare")
- Window Bounds (Left/Right)
- Partitioning (Read/Write or Hoare/Lomuto-style)
- Bidirectional Merge / Set Ops
Each implementation includes security considerations to prevent:
- Out-of-bounds access
- Integer overflow/underflow
- Timing attacks
- Resource exhaustion
The two-pointer-5-types/out-of-bounds-protection directory contains specialized implementations focused on preventing out-of-bounds access and memory corruption vulnerabilities.
Comprehensive test suites including:
- Unit tests
- Property-based tests
- Attack-defense tests