Search for a tool
PlayFair Cipher

Tool to decrypt/encrypt with Playfair cipher, a symmetrical encryption process based on a polygrammic substitution, created in 1854 by Charles Weatstone.

Results

PlayFair Cipher -

Tag(s) : Polygrammic Cipher

Share
dCode and more

dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Thanks to your feedback and relevant comments, dCode has developed the best 'PlayFair Cipher' tool, so feel free to write! Thank you!

PlayFair Cipher

PlayFair Decoder

Loading...
(if this message do not disappear, try to refresh this page)

PlayFair Encoder

Loading...
(if this message do not disappear, try to refresh this page)

Answers to Questions (FAQ)

How to encrypt using PlayFair cipher?

Playfair encryption uses a grid, which can be generated by a key word.

Example: Crypt DCODE with the grid:

1 2 3 4 5 \ A B C D E F G H I J K L M N O P Q R S T U W X Y Z

Split the text into pairs of letters (bigrams) and apply the following rules according to the letters positions in the grid:

- if the 2 letters are identical (or if there is only one remaining) insert another letter (for example a X or a Q) after the first letter and cipher the new bigram thus formed

Example: AABCD becomes AXABCD

- if the 2 letters are on the same line, replace them by the ones on their right (loop to the left if the edge of the grid is reached),

Example: C and D are coded DE

- if the 2 letters are on the same column, replace them by the ones directly under (loop to the top if the bottom of the grid is reached),

Example: A and F are coded FK

- else, replace the letters by the ones forming a rectangle with the original pair. The coded bigram begins with the letter on the same line as the first letter to cipher.

Example: AG is crypted BF, FB is crypted GA

How to decrypt PlayFair cipher?

Playfair decryption requires a grid, which can be generated by a key word.

Example: Decrypt DCODE with the grid:

1 2 3 4 5 \ A B C D E F G H I J K L M N O P Q R S T U W X Y Z

Split the text into pairs of letters (bigrams) and apply the following rules according to the letters positions in the grid:

- if the 2 letters are on the same line, replace them by the ones on their left (loop to the right if the edge of the grid is reached),

Example: DE is decrypted CD.

- if the 2 letters are on the same column, replace them by the ones directly above (loop to the bottom if the top of the grid is reached),

Example: FK is decrypted AF.

- else, replace the letters by the ones forming a rectangle with the original pair. Beginning with the letter on the same line as the first letter to crypt.

Example: BF is decrypted AG, GA is decrypted FB

How to recognize PlayFair ciphertext?

The ciphered message has an even number of letters.

The message may have 25 distinct letters at most (the number of letters in the grid)

It is impossible to find a bigram composed of 2 identical letters

It is impossible that a letter is crypted by itself. (Thanks to LeSingeMalicieux)

All references to games and fair play are clues.

How to decipher PlayFair without grid?

PlayFair can be cracked using a known plaintext attack in order to discover a part of the grid.

Multiple grids can fit a PlayFair cipher?

Several squares can be used for the same decryption of Playfair, in fact, once a square grid of 25 is found, other squares obtained from the previous by rotating rows and / or columns gives the same result.

What are the variants of the PlayFair cipher?

Multiple variants can be found when encrypting bigrams. When letters are in column or in lines, it is possible to cipher with the on on the right or on the left, or above or below. Again, when the letters are diagonally positioned, it is possible to write letter1-letter2 or letter2-letter1

When PlayFair was invented?

1854 by Charles Wheatstone, after the name of one of his friends Lord Playfair.

Source code

dCode retains ownership of the online 'PlayFair Cipher' tool source code. Except explicit open source licence (indicated CC / Creative Commons / free), any 'PlayFair Cipher' algorithm, applet or snippet (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, translator), or any 'PlayFair Cipher' function (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) and no data download, script, copy-paste, or API access for 'PlayFair Cipher' will be for free, same for offline use on PC, tablet, iPhone or Android ! dCode is free and online.

Need Help ?

Please, check our dCode Discord community for help requests!
NB: for encrypted messages, test our automatic cipher identifier!

Questions / Comments

Thanks to your feedback and relevant comments, dCode has developed the best 'PlayFair Cipher' tool, so feel free to write! Thank you!

Source : https://www.dcode.fr/playfair-cipher
© 2021 dCode — The ultimate 'toolkit' to solve every games / riddles / geocaching / CTF.
Feedback