Refactor to create make use of already well implemented Java Crypto.