Stanford Javascript Crypto Library basic AES example
✓ Published0🌍 Public
Aalessioalex
Last edited Feb 5, 2017
Created on Jul 11, 2018
This example demonstrates symmetric encryption and decryption with the Stanford Javascript Crypto Library (SJCL), showing how a plaintext message is converted into a JSON ciphertext object and then restored to its original form. The code uses `sjcl.encrypt` with a password-derived key, applying the default AES cipher and PBKDF2 key stretching with 1000 iterations as specified in the `parameters` object. It also calls `sjcl.misc.cachedPbkdf2` to precompute the key material, and outputs both the encrypted JSON and the decrypted text via `console.log`. No external data source is involved; the text and password are hardcoded strings.
AI-generated description