Skip to content

feat: add automated cipher identification and cryptanalysis engine - #1674

Merged
csxark merged 1 commit into
csxark:mainfrom
karan-chaos:feature/brute-force-attack-simulator
Aug 28, 2026
Merged

feat: add automated cipher identification and cryptanalysis engine#1674
csxark merged 1 commit into
csxark:mainfrom
karan-chaos:feature/brute-force-attack-simulator

Conversation

@karan-chaos

@karan-chaos karan-chaos commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Summary

Resolves #1673
This PR introduces a complete automated cryptanalysis engine for analyzing
unknown ciphertext and identifying likely cipher or encoding methods.

It combines seven statistical tests, cipher-specific classifiers, ranked
candidate results, and an interactive React interface for exploring
cryptanalysis results.

Changes

Cryptanalysis Engine

Implemented statistical analysis using:

  • Index of Coincidence
  • Entropy analysis
  • Chi-square analysis
  • Kasiski examination
  • Digram matching
  • Trigram matching
  • Frequency analysis

Cipher Classification

Added 14 cipher and encoding classifiers covering:

  • Caesar
  • ROT13
  • Vigenère
  • Playfair
  • Transposition
  • Affine
  • Atbash
  • XOR
  • Hex encoding
  • Base64 encoding
  • Binary encoding
  • Additional supported cipher patterns

Candidate Ranking

Added functionality to:

  • Analyze unknown ciphertext
  • Generate possible cipher classifications
  • Score candidates
  • Rank likely cipher types
  • Provide supporting analysis metrics

Interactive UI

Added a React interface featuring:

  • Ciphertext analysis controls
  • Frequency bar charts
  • Statistical metric cards
  • Ranked candidate results
  • Expandable explanations
  • Educational metric descriptions
  • 10 quick-load sample ciphers

Educational Analysis

Added explanations for the statistical methods used during analysis,
helping users understand how each metric contributes to cipher
identification.

Testing

Added 45+ unit tests validating:

  • Statistical analysis
  • IC calculations
  • Entropy
  • Chi-square analysis
  • Kasiski examination
  • Digram and trigram matching
  • Cipher classifiers
  • Candidate ranking
  • Complete analysis pipeline
  • Edge cases

Verification

  • Statistical tests verified
  • Frequency analysis verified
  • Cipher classifiers verified
  • Candidate ranking verified
  • Unknown ciphertext analysis verified
  • Frequency charts verified
  • Metric cards verified
  • Result explanations verified
  • Sample ciphers verified
  • Full analysis pipeline verified
  • 45+ unit tests passing

Introduce a new cryptanalysis tool that identifies unknown ciphertext using
statistical analysis: frequency analysis, index of coincidence, Shannon
entropy, chi-squared testing, Kasiski examination, and digram/trigram pattern
matching. Includes interactive React UI with frequency charts, educational
metrics explanations, sample ciphertexts, and 45+ unit tests.

🤖 Generated with Codebuff
Co-Authored-By: Codebuff <noreply@codebuff.com>
@vercel

vercel Bot commented Aug 28, 2026

Copy link
Copy Markdown

@karan-chaos 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 @karan-chaos,

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 28, 2026

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

Next included review available in 50 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3484b6d0-d48f-464f-aefd-a44e9074f963

📥 Commits

Reviewing files that changed from the base of the PR and between d227a75 and 273ad34.

📒 Files selected for processing (4)
  • app/cipher-identifier/page.tsx
  • components/cryptanalysis/CipherIdentifier.tsx
  • lib/cryptanalysis/cipherIdentifier.ts
  • tests/unit/cipherIdentifier.test.ts

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.

@csxark csxark added ECSoC26 Elite Coders Summer of Code 2026 good-issue and removed needs review labels Aug 28, 2026
@csxark
csxark merged commit 4af6fc1 into csxark:main Aug 28, 2026
3 of 4 checks passed
@github-actions

Copy link
Copy Markdown
Contributor

🎉 Pull Request Merged

Hello @karan-chaos,

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-L3 ECSoC26 Elite Coders Summer of Code 2026 good-issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement Automated Cipher Identification and Cryptanalysis Engine

2 participants