playfair cipher Algorithm

The Playfair cipher or Playfair square or Wheatstone-Playfair cipher is a manual symmetric encryption technique and was the first literal digram substitution cipher. The technique encrypts pairs of letters (bigrams or digrams), instead of individual letters as in the simple substitution cipher and rather more complex Vigenère cipher systems then in purpose." 

It was however later used for tactical purposes by British forces in the Second Boer War and in universe War I and for the same purpose by the British and Australians during universe War II.Wheatstone invented the cipher for secrecy in telegraphy, but it carry the name of his friend lord Playfair, first Baron Playfair of St. Andrews, who promoted its purpose. The Playfair cipher was the first cipher to encrypt pairs of letters in cryptologic history.

playfair cipher source code, pseudocode and analysis