Add Gronsfeld cipher implementation #11966
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Describe your change:
This pull request adds new functionality to the
ciphers/gronsfeld.py
file by implementing the Gronsfeld cipher for both encryption and decryption. The main changes include the addition of two functions:gronsfeld_encrypt
andgronsfeld_decrypt
, along with an example usage section.New functionality:
ciphers/gronsfeld.py
: Added thegronsfeld_encrypt
function to encrypt plaintext using the Gronsfeld cipher.ciphers/gronsfeld.py
: Added thegronsfeld_decrypt
function to decrypt ciphertext using the Gronsfeld cipher.Example usage:
ciphers/gronsfeld.py
: Included an example usage section to demonstrate how to use thegronsfeld_encrypt
andgronsfeld_decrypt
functions.This commit adds the implementation of the Gronsfeld cipher, which includes functions for encrypting and decrypting messages using a numeric key. The
gronsfeld_encrypt
function takes a plaintext message and a key as input and returns the encrypted message. Thegronsfeld_decrypt
function takes a ciphertext message and a key as input and returns the decrypted message. The implementation also includes an example usage section that demonstrates how to encrypt and decrypt a message using the Gronsfeld cipher.Closes #11835