TextPlayfair cipher. The TextPlayfair is a primitively modern reckoning block cipher. Any new personal computer sold today can break a message encoded with it in a matter of seconds. That is, with the proper software, you could use such a computer to discover the original text without knowing the cipher key. Some skilled cryptogrophists and puzzle experts can even break it with nothing more than pen and paper. Nonetheless, it uses some principles common to modern computer block ciphers. Understanding the TextPlayfair will give you a beginning insight into modern cryptographywithout all the complex mathematics and number theory. TextPlayfair Cipher uses a 5x5 or 9x9 square, in which the letters of an agreed key word or phrase are entered (suppressing duplicates), followed by the rest of the alphabet in order (if 5x5 is used then an alphabet with 25 letters is used where I and J would usually be combined together, if 9x9 is used a broader range of symbols is used. The more the symbols, the more the characters that can be encrypted). The message to be enciphered is split into pairs of letters. If the two letters in the pair are in the same row, the letters to the right of each are used. If they are in the same column, the letters below each are used. Otherwise, the letters at the opposite corners of the rectangle are used. Special treatment is required for identical pairs of letters and a single letter left over at the end. Typically an obscure letter such as X would have been inserted to pad out the message. LLCryptoLib implementations assumes, instead of the original 5x5 or 9x9 cipher, a combined 36x36 square.

Namespace: LLCryptoLib.Crypto
Assembly: LLCryptoLib (in LLCryptoLib.dll) Version: 2.0.1024.0 (2.0.1024)

Syntax

C#
public class TextPlayfair : TextAlgorithm
Visual Basic
Public Class TextPlayfair _
	Inherits TextAlgorithm
Visual C++
public ref class TextPlayfair : public TextAlgorithm

Examples

Playfair text encryption:
CopyC#
TextAlgorithmParameters parms = null;
TextCrypter textEncrypter = TextCrypterFactory.Create(SupportedTextAlgorithms.PLAYFAIR, parms);
string encrypted = textEncrypter.TextEncryptDecrypt(origString, true);
Console.WriteLine("Encrypted string: " + encrypted);
string decrypted = textEncrypter.TextEncryptDecrypt(encrypted, false);
Console.WriteLine("Decrypted string: " + decrypted);
Console.WriteLine();

Inheritance Hierarchy

System..::..Object
  LLCryptoLib.Crypto..::..TextAlgorithm
    LLCryptoLib.Crypto..::..TextPlayfair

See Also