Moved encryption to its own module