Extract hash functions from EncryptionUtil to HashUtil

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>
Move hash comparison to HashUtil

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>
Extract serialization to separate util

Signed-off-by: Nico Rutishauser <nr@hotmail.ch>