Skip to content
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

Feat: Add playfair cipher #2813

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

JaydityaDhaka
Copy link

Description of Change

This pull request adds the implementation of the Playfair Cipher algorithm. The Playfair cipher is a digraph substitution cipher, which encrypts pairs of letters from the plaintext using a 5x5 grid. It provides both encryption and decryption functions, handling edge cases such as repeated letters and handling of the 'j' character by replacing it with 'i'.

Key Features:

  • Implementation of the encryption and decryption methods.
  • A utility to clean input strings by removing non-alphabet characters and converting the text to lowercase.
  • Generation of the Playfair 5x5 grid based on a provided key.
  • Supports formatted digraphs and insertion of 'x' for repeated characters and padding.

Checklist

[x] Added description of change
[x] Added file name matches File name guidelines
[x] Added tests and example, test must pass
[x] Added documentation so that the program is self-explanatory and educational - Doxygen guidelines
[x] Relevant documentation/comments is changed or added
[x] PR title follows semantic commit guidelines
[x] Search previous suggestions before making a new one, as yours may be a duplicate.
[x] I acknowledge that all my contributions will be made under the project's license.

Notes:
This pull request includes a detailed file header using Doxygen-style comments, an example of usage with both encryption and decryption of sample text, and test cases to ensure the correctness of the algorithm.

@JaydityaDhaka JaydityaDhaka changed the title Feature :Added playfair cipher Feat: Add playfair cipher Oct 11, 2024
@JaydityaDhaka
Copy link
Author

are there any additional requirments for this PR?

ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
@JaydityaDhaka
Copy link
Author

JaydityaDhaka commented Oct 18, 2024

Have put in all the necessary changes, could you also add Hacktoberfest tag

ciphers/playfair_cipher.cpp Show resolved Hide resolved
ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
ciphers/playfair_cipher.cpp Outdated Show resolved Hide resolved
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants