Skip to content

[FEATURE] Add Salsa20 Stream Cipher Module #253

Description

@Aakif-Kohari

Summary

CryptoViz has no ARX-based stream cipher in the visualizer despite @noble/ciphers already being a project dependency (per README tech stack) and supporting Salsa20 natively. Adding it demonstrates a modern stream-cipher construction alongside the existing XOR/OTP stream examples.

What's missing

  • No lib/cipher/salsa20.ts
  • No visualizer entry, worker routing, or tests

Proposed implementation

  • Thin instrumented wrapper around @noble/ciphers/salsa20 for real output (correctness/security), with a parallel pure-TS quarter-round instrumentation path for step visualization (same "instrumented vs fast path" split used for AES per CIPHER_ENGINE.md section 5.6)
  • Visualize the 4x4 state matrix and quarter-round diffusion (ADD/XOR/ROTATE) similar to how AES steps show the 4x4 state
  • Security status: secure
  • Verify against the official Salsa20 test vectors (256-bit key, ECRYPT test set)

Acceptance criteria

  • Output matches @noble/ciphers reference output exactly
  • Quarter-round steps rendered as milestone steps
  • Unit tests against ECRYPT Salsa20 vectors
  • Fuzz test: encrypt→decrypt round-trip for arbitrary byte arrays
  • Dark/light mode support via existing theme system

Assignment

I'd like to work on this issue under ECSoC26. Will open a PR only after approval/assignment by @csxark or another maintainer.

Metadata

Metadata

Assignees

Labels

ECSoC26Elite Coders Summer of Code 2026

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions