This example worked in a similar fashion as the Arduino code shown above: github.com/ricmoo/aes-js/blob/master/README.md This tutorial is helpful if you are new at encryption.