Refactor Encrypt class

Signed-off-by: Antti-Ville Jokela <jokela.anttiville@gmail.com>