Decryption refactoring

Mainly refactoring for decryption classes, a new function added for
verfying encryption