Moved crypto helper methods into crypto.js