Solitaire is an output-feedback mode stream cipher. Sometimes this is called a key-generator (KG in U.S. military speak). The basic idea is that Solitaire generates a stream, often called a "keystream," of numbers between 1 and 26. To encrypt, generate the same number of keystream letters as plaintext letters. Then add them modulo 26 to plaintext letters, one at a time, to create the ciphertext. To decrypt, generate the same keystream and subtract modulo 26 from the ciphertext to recover the plaintext.