npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

cryptbrau

v1.0.1

Published

Simple in-browser encryption (symmetric).

Readme

CryptBrau

Simple symmetric encryption for Node.js and the browser. Wraps the simple-encryptor library with a key+salt configuration pattern and lazy encryptor initialization.

npm version License: MIT


Features

  • Symmetric Encryption - Encrypt and decrypt messages with a shared key and salt
  • Lazy Initialization - The encryptor is created on first use, not at construction time
  • Key + Salt Pattern - Concatenates a key and salt string to build the full encryption key, with automatic minimum-length padding
  • Browser Compatible - Works in both Node.js and browser environments via the bundled browser shim

Installation

npm install cryptbrau

Quick Start

const cryptBrau = require('cryptbrau');

let encryptor = cryptBrau({ Key: 'MySecretKey', Salt: 'MySaltValue' });

let encrypted = encryptor.encrypt('Hello, World!');
console.log('Encrypted:', encrypted);

let decrypted = encryptor.decrypt(encrypted);
console.log('Decrypted:', decrypted); // "Hello, World!"

Usage

Object Configuration

Pass an options object with Key and Salt properties:

let encryptor = cryptBrau({ Key: 'SomeVerySecureKeyReally', Salt: 'SomeKindOfSalt' });

String Shorthand

Pass a string directly and it will be used as the key with a default salt:

let encryptor = cryptBrau('MySecretKey');

Browser Usage

Include the browser bundle and access via window.cryptBrau:

<script src="lib/cryptbrau.js"></script>
<script>
    var encryptor = cryptBrau({ Key: 'BrowserKey', Salt: 'BrowserSalt' });
    var encrypted = encryptor.encrypt('Secret message');
</script>

API

cryptBrau(pOptions)

Create an encryptor instance.

| Parameter | Type | Description | |-----------|------|-------------| | pOptions | Object or String | Configuration object with Key and Salt, or a string used as the key |

Returns an encryptor object with encrypt and decrypt methods.

Options:

| Property | Type | Default | Description | |----------|------|---------|-------------| | Key | String | 'ThisIsNotSecureEnough.' | The encryption key | | Salt | String | '0000000000000000' | Salt appended to the key |

The key and salt are concatenated to form the full encryption key. If the combined string is shorter than 16 characters, it is padded automatically.

encryptor.encrypt(pMessage)

Encrypt a message string. Returns the encrypted string.

encryptor.decrypt(pMessage)

Decrypt an encrypted message string. Returns the original plaintext.

Part of the Retold Framework

CryptBrau is used in the Pict ecosystem for client-side encryption:

  • pict - UI framework
  • fable - Application services framework

Related Packages

  • fable - Application services framework

License

MIT

Contributing

Pull requests are welcome. For details on our code of conduct, contribution process, and testing requirements, see the Retold Contributing Guide.