It would be more clear to has separate class for encryption/decryption stuff. Other cleanup is welcomed as well.