A simple and safe promise-based text+binary encryption library for browsers. It uses plain text keys and plain-text-capable (JSON) ciphertext output for easy integration and storage. Keeping with best practices, the AES Encryption keys are derived from the plain text password using 100,000 rounds of PBKDF with SHA256 to prevent brute-forcing guessing.
There are only 2 methods:
See it in action on a dead-simple encode/decode demo.
aes4js.encrypt("123", "hello world") // encrypt with password 123 .then(aes4js.decrypt.bind(this, "123")) // decrypt .then(alert) // display decrypted value
aes4js uses no outside code libraries, but does require several native browser APIs and Classes: