Java implmentation of the 3way Encryption Algorithm