Moved encrypt/decrypt functions to module file.