How to Encypt & Decrypt using Javascript & Selenium IDE

Tags: 

This article explains how to encrypt & decrypt with JavaScript and the Selenium IDE. You will need the attached user-extension.js installed, which was created from this article: https://code.google.com/p/crypto-js/#AES. Below are the IDE commands that can get you started:

storeEval | CryptoJS.AES.encrypt("Message", "Secret Passphrase"); | encryptedRaw
store | ${encryptedRaw} | encrypted
echo | ${encrypted} 
storeEval | CryptoJS.AES.decrypt("${encrypted}", "Secret Passphrase"); | decrypted
echo | ${decrypted} 
storeEval | storedVars['decrypted'].toString(CryptoJS.enc.Utf8); | password
echo | ${password} 

Below is a screenshot of the same commands, but executed in the IDE, so with logging output.

File: