# node-passworder **Repository Path**: mirrors_miguelmota/node-passworder ## Basic Information - **Project Name**: node-passworder - **Description**: A simple browserifiable module for encrypting and decrypting JSON-serializable objects with a password. - **Primary Language**: Unknown - **License**: ISC - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2021-03-04 - **Last Updated**: 2026-02-15 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README # Node Passworder [![CircleCI](https://circleci.com/gh/flyswatter/browser-passworder.svg?style=svg)](https://circleci.com/gh/flyswatter/browser-passworder) A simple module for encrypting & decrypting Javascript objects with a password in the browser. Note: This is a fork of [`browser-passworder`](https://github.com/danfinlay/browser-passworder) so it works with Node.js Serializes the encrypted payload as a string of text for easy storage. Uses native crypto to be the lightest possible module you can have, with the most vetted internals you could ask for (the real guts here are implemented by node). ## Installation You need to have node.js installed. ```bash npm install node-passworder ``` ## Usage ```javascript var passworder = require('node-passworder') var secrets = { coolStuff: 'all', ssn: 'livin large' } var password = 'hunter55' passworder.encrypt(password, secrets) .then(function(blob) { return passworder.decrypt(password, blob) }) .then(function(result) { assert.deepEqual(result, secrets) }) ``` There are also some more advanced internal methods you can choose to use, but that's the basic version of it. The most advanced alternate usage would be if you want to cache the password-derived key to speed up performance for many encryptions/decryptions with the same password. ## Details The serialized text is stored as a JSON blob that includes two base64-encoded fields, `data` and `iv`, neither of which you need to worry about. The data is encrypted using the `AES-GCM` algorithm. It is salted with the result of `crypto.getRandomValues()`, and the encryption vector is generated the same way. ## Running Tests ```bash npm test ```