broke out encryption into separate module