Continuing http://programmingpraxis.com/2014/12/19/diana-cryptosystem/