Skip to content

test(railfence): document 26-char convention and add unambiguous test… - #991

Merged
csxark merged 1 commit into
csxark:mainfrom
Atharv094:fix/railfence-867
Aug 10, 2026
Merged

test(railfence): document 26-char convention and add unambiguous test…#991
csxark merged 1 commit into
csxark:mainfrom
Atharv094:fix/railfence-867

Conversation

@Atharv094

@Atharv094 Atharv094 commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Description

Added documentation and additional test vectors to the Rail Fence cipher
to resolve ambiguity around the commonly cited WEAREDISCOVEREDFLEEAATONCE example.


Related Issue

Closes #867


Type of Change

  • Bug Fix
  • New Feature
  • Documentation
  • Documentation
  • UI/UX Improvement
  • Refactoring
  • Performance Improvement
  • Accessibility

Changes Made

  • Added comment above existing vector documenting the 26-character input convention and the 25-character ambiguity from some sources
  • Added HELLOWORLD/2-rail vector (trivially hand-verifiable)
  • Added ATTACKATDAWN/3-rail vector (trivially hand-verifiable)

Testing

  • Tested locally
  • No console errors
  • Existing functionality works as expected

Screenshots

N/A — no UI changes.


Checklist

  • My code follows the project guidelines.
  • I have tested my changes.
  • I have updated the documentation if required.
  • My changes address the related issue.
  • This PR focuses on a single issue.

Additional Notes

All three test vectors confirmed via encryptFast. Encrypt→decrypt round-trips pass for all vectors.

Summary by CodeRabbit

  • Tests
    • Added verified Rail Fence cipher test cases for two-rail and three-rail encryption examples.
    • Expanded explanatory comments for the existing 26-character example.

… vectors

- Added comment above existing vector documenting the 26-character
  input convention and the 25-character ambiguity from some sources
- Added HELLOWORLD/2-rail vector (trivially hand-verifiable)
- Added ATTACKATDAWN/3-rail vector (trivially hand-verifiable)
- All vectors confirmed via encryptFast; round-trips pass

Closes csxark#867
@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@Atharv094 is attempting to deploy a commit to the csxark's projects Team on Vercel.

A member of the Team first needs to authorize it.

@github-actions

Copy link
Copy Markdown
Contributor

🎉 Thank You for Your Contribution

Hello @Atharv094,

Thank you for submitting a Pull Request to CryptoViz. We appreciate the time and effort you've invested in contributing to the project.

Your Pull Request has been received successfully and will be reviewed by the maintainers as soon as possible.

📋 Pull Request Checklist

  • ✅ Linked the related issue
  • ✅ No merge conflicts
  • ✅ Synced with the latest main branch
  • ✅ Build passes successfully
  • ✅ All tests pass

Ensuring these requirements are met helps streamline the review process and enables maintainers to review your contribution more efficiently.

❤️ Support CryptoViz

If you find CryptoViz helpful, consider supporting the project by:

  • ⭐ Starring the repository
  • 🍴 Forking the repository
  • 👤 Following Ark on GitHub
  • 💼 Connecting on LinkedIn
  • 🌐 Visiting the Portfolio

Your support helps increase the project's visibility and encourages continued development. Thank you for being a part of the CryptoViz community!

Thank you once again for contributing to CryptoViz. We appreciate your support and look forward to reviewing your contribution.

@coderabbitai

coderabbitai Bot commented Aug 10, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: eac14dcb-59e0-48bf-b96d-9f65888faef9

📥 Commits

Reviewing files that changed from the base of the PR and between 42227fa and 937af0a.

📒 Files selected for processing (1)
  • lib/cipher/classical/railfence.ts

📝 Walkthrough

Walkthrough

The Rail Fence test vectors now document the existing 26-character example and include additional encryption vectors for HELLOWORLD with 2 rails and ATTACKATDAWN with 3 rails.

Changes

Rail Fence test vector updates

Layer / File(s) Summary
Documented and expanded vectors
lib/cipher/classical/railfence.ts
The existing 26-character vector now includes explanatory documentation. The vector set adds encryption cases for HELLOWORLD with 2 rails and ATTACKATDAWN with 3 rails.

Estimated code review effort: 1 (Trivial) | ~2 minutes

Suggested labels: good-pr, ECSoC26-L1

Suggested reviewers: csxark

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the Rail Fence documentation update and addition of an unambiguous test vector.
Linked Issues check ✅ Passed The changes satisfy issue #867 by documenting the convention and adding verified unambiguous vectors with round-trip validation.
Out of Scope Changes check ✅ Passed All changes are limited to Rail Fence test-vector documentation and coverage requested by issue #867.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Atharv094

Copy link
Copy Markdown
Contributor Author

@csxark The CI failures are pre-existing and unrelated to this PR. All failures are in skipjack.test.ts, rainbowTable.test.ts, benchmark.test.ts, and other files not touched by this PR. This PR only modifies lib/cipher/classical/railfence.ts (+23 lines of comments and test vectors). The railfence tests themselves pass.

@csxark csxark added ECSoC26 Elite Coders Summer of Code 2026 and removed needs review labels Aug 10, 2026
@csxark
csxark merged commit cec2f82 into csxark:main Aug 10, 2026
3 of 7 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Pull Request Merged

Hello @Atharv094,

Thank you for your contribution to CryptoViz. Your Pull Request has been reviewed and successfully merged into the project.

We sincerely appreciate the time and effort you invested in improving the project. Contributions like yours help make CryptoViz better for the entire community.

We look forward to your future contributions and hope to collaborate with you again.

❤️ Support CryptoViz

If you find CryptoViz helpful, consider supporting the project by:

  • ⭐ Starring the repository
  • 🍴 Forking the repository
  • 👤 Following Ark on GitHub
  • 💼 Connecting on LinkedIn
  • 🌐 Visiting the Portfolio

Your support helps increase the project's visibility and encourages continued development. Thank you for being a part of the CryptoViz community!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

ECSoC26-L1 ECSoC26 Elite Coders Summer of Code 2026

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Document Rail Fence test vector convention and verify against standard references

2 participants