Python version of the Solitaire encryption algorithm