Moved crypt functions to crypt.js