Skip to content

[FEATURE] Add Autokey Vigenère Cipher Module #256

Description

@Aakif-Kohari

Summary

The Classical category has plain Vigenère but not its stronger historical variant, Autokey Vigenère — where the keystream extends using the plaintext itself (rather than repeating the key), removing the periodicity that makes standard Vigenère breakable via Kasiski examination. This is a natural companion entry next to the existing vigenere.ts and reuses none of its state (separate file, separate registry id).

What's missing

  • No lib/cipher/classical/autokey.ts
  • Not in registry, worker router, or CipherName type

Proposed implementation

  • Encrypt: keystream = key + plaintext (plaintext extends the key once it runs out); C(i) = (P(i) + K(i)) mod 26
  • Decrypt: keystream reconstructed progressively — each recovered plaintext letter extends the stream for later positions; P(i) = (C(i) - K(i)) mod 26
  • Steps: key setup (show initial key) + per-character step showing the running keystream extension, reusing the alignment-table step pattern already used by vigenere.ts
  • Security status: broken (still vulnerable to probable-word/crib attacks, though stronger than repeating-key Vigenère)
  • Test vector (round-trip verified): key QUEENLY, plaintext ATTACKATDAWN → ciphertext QNXEPVYTWTWP

Acceptance criteria

  • Matches the listed test vector exactly
  • Round-trip encrypt→decrypt correct, including when input is longer than the key
  • Vitest unit + fast-check fuzz test (never throws unhandled errors on arbitrary ASCII, per CONTRIBUTING pattern)
  • Registered in registry/worker/CipherName type
  • 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