Change the order of encrypt steps. Add few methods and updated main class.

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