Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: Add a Cryptography Algorithm Playfair cipher #2082

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
Dhvani365 wants to merge 1 commit into trekhleb:master
base: master
Choose a base branch
Loading
from Dhvani365:playfair-algo

Conversation

@Dhvani365
Copy link

@Dhvani365 Dhvani365 commented Oct 22, 2025

Added Playfair cipher (JavaScript) in Cryptography Algorithms

What:
Adds implementation of the Playfair cipher in JavaScript, including encrypt and decrypt functions. Includes README explanation and unit tests.

Why:
The repository already includes classical ciphers (Caesar, Rail-Fence, Hill). The Playfair cipher is a historically important digraph substitution cipher and completes this cryptography section.

How:

  • playfairCipher.js contains the core logic (Key matrix creation, pair creation, pairwise encryption and decryption)
  • README.md explains the algorithm, how to use the code and sample input/output
  • playfairCipher.test.js includes tests for typical and edge cases

Testing:
Run npm test — all tests should pass, including new ones.

Checklist:

  • Code follows the style of existing algorithms in the repo
  • Explanations/documentation added
  • Tests added and passing
  • No breaking changes

Copy link

What's the point of submitting it here when we can all generate it the same way you did?

Copy link
Author

Dhvani365 commented Oct 23, 2025
edited
Loading

What's the point of submitting it here when we can all generate it the same way you did?

Implementing code is different thing, but learning from this is an important thing. As part of my learning, I wanted to implement some of the standard algorithms in javascript (this is one of them). This PR if merged with javascript-algorithms repository shows my learning and contribution as well as motivates beginners to implement such standard algorithms in javascript and contribute!

lazarljubenovic reacted with laugh emoji

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

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /