Skip to content

Add VIC cipher codec#36

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/add-vic-encoding
Draft

Add VIC cipher codec#36
Copilot wants to merge 2 commits intomainfrom
copilot/add-vic-encoding

Conversation

Copy link
Contributor

Copilot AI commented Mar 23, 2026

Checklist

  • No unrelated changes
  • Codec is new (not already implemented)
  • Tests included (if cannot be automated with tests/test_generated)
  • Documentation (included in the right page in docs/pages/enc)

Description

The VIC cipher is a Soviet spy cipher combining a straddling checkerboard substitution with a double columnar transposition. Reference: https://www.dcode.fr/vic-cipher

Checkerboard: A keyword-mixed 26-letter alphabet fills a 3-row grid with blanks at columns 2 and 6. Top-row letters get single-digit codes; the two lower rows get two-digit codes prefixed by their blank-column header — producing a self-synchronising digit stream.

Double transposition: Two independent columnar transpositions are applied sequentially to the digit stream, each driven by its own key.

Codec name: vic-KEYWORD-TRANS1KEY[-TRANS2KEY]TRANS2KEY defaults to TRANS1KEY when omitted.

>>> codext.encode("HELLO", "vic-python-352")
'42228285'
>>> codext.decode("42228285", "vic-python-352")
'HELLO'
>>> codext.encode("ATTACKATDAWN", "vic-python-352-461")
'8833231882605277'
>>> codext.decode("8833231882605277", "vic-python-352-461")
'ATTACKATDAWN'

Roundtrip tests are covered by __examples__ and exercised automatically via tests/test_generated.

Original prompt

This section details on the original issue you should resolve

<issue_title>Add new encoding: vic</issue_title>
<issue_description>### Description

The VIC cipher is a substitution cipher with an overencryption using transposition, named after a spy called Victor.

Reference

https://www.dcode.fr/vic-cipher</issue_description>

<agent_instructions>Propose an implementation that satisfies the guideline at docs/pages/howto.md.</agent_instructions>

Comments on the Issue (you are @copilot in this section)


🔒 GitHub Advanced Security automatically protects Copilot coding agent pull requests. You can protect all pull requests by enabling Advanced Security for your repositories. Learn more about Advanced Security.

Copilot AI changed the title [WIP] Add new encoding for VIC cipher Add VIC cipher codec Mar 23, 2026
Copilot AI requested a review from dhondta March 23, 2026 23:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add new encoding: vic

2 participants