Skip to content

Playfair Cipher Solution - TypeScript#396

Open
Sajantoor wants to merge 4 commits intoShopify:mainfrom
Sajantoor:main
Open

Playfair Cipher Solution - TypeScript#396
Sajantoor wants to merge 4 commits intoShopify:mainfrom
Sajantoor:main

Conversation

@Sajantoor
Copy link

This pull request introduces the Decryptor class, designed to decrypt messages encoded with the Playfair cipher. It outputs the decrypted text for IKEWENENXLNQLPZSLERUMRHEERYBOFNEINCHCV using the encryption key SUPERSPY and "X" as the padding character.

Main Features:

  • Decryptor Class: Core class responsible for decrypting messages.
  • Key Grid Generation: Creates a 5x5 grid based on the encryption key, omitting the letter 'J'. The positions of each character is hashed, allowing for O(1) look up for the position of characters. For long strings this provides a significant performacne improvement.
  • Decryption Logic: Handles decryption of letter pairs according to Playfair cipher rules.
  • Static Decrypt Method: Provides a convenient way to decrypt messages without instantiating the class.
  • Position interface: Easily represent positions of characters on the grid.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant