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

@ashish-dev-creation/emoji-crypt

v1.0.3

Published

AES-256-GCM encryption with emoji-based encoding.

Readme

emoji‑crypto


emoji‑crypto is a playful yet powerful Node.js library that turns raw ciphertext into walls of 📙😃🔑 emojis while keeping the underlying security rock‑solid with AES‑256‑GCM and PBKDF2‑SHA‑256. Use it to build fun chat experiences, obfuscate logs, or teach modern symmetric‑key cryptography step‑by‑step.

✨ Features

| Feature | Details | | ----------------------------------- | --------------------------------------------------------------------- | | 🔐Strong encryption | AES‑256‑GCM for confidentialityandintegrity | | 🏋️‍♀️Robust key derivation | PBKDF2 (SHA‑256) with configurable salt & iterations | | 🧩Emoji framing | 256‑emoji map → 1‑to‑1 byte representation | | 🚀Stream friendly | Transform streams so you can pipe buffers in and encrypted‑emoji out | | ☑️Typed | Full TypeScript type declarations included | | 🛠Hackable | Swap out the emoji map, KDF params, IV length, etc. viaconfigure() |

📦 Installation

npm version

Live Demo on Vercel

npm install @ashish-dev-creation/emoji-crypt
# or
yarn add @ashish-dev-creation/emoji-crypt

⚡ Quick Start

import { EmojiCrypto } from 'emoji-crypto';

// 1. Create an instance (passphrase or raw key)
const crypto = new EmojiCrypto('correct horse battery staple');

// 2. Encrypt text → emoji wall
const secret = crypto.encrypt('Hello, world!');
console.log(secret); // 🥳🔒🤖🌟…

// 3. Decrypt emoji back → text
console.log(crypto.decrypt(secret)); // "Hello, world!"

🛠 Customising with configure()

Need a different security posture or branded emojis? Create your own factory using configure(overrides):

import { configure } from 'emoji-crypto';

// Bring your own 256‑emoji array (✅ must be *single‑grapheme* emojis)
import my256EmojiArray from './myEmojiBank.js';

// 1️⃣ Build a custom constructor
const CustomCrypto = configure({
  // 🔑 Key‑derivation tweaks (⬆️ default: 100k iterations, 16‑byte salt)
  keyDerivation: {
    iterations: 500_000,
    saltBytes: 32,      // bigger random salt
  },
  // 🖼 Custom emoji alphabet
  emojiMap: my256EmojiArray,
});

// 2️⃣ Use like the default class
const crypto = new CustomCrypto('sup3rs3cret');
const msg = crypto.encrypt('🔒 personalised & stronger!');

Heads‑up: Under the hood the call above just merges your overrides onto the defaults exported from src/config.js. See code snippet below.

Default Configuration (from src/config.js)

const DEFAULT = {
  algorithm: 'aes-256-gcm',
  ivBytes: 12,               // 96‑bit IV (recommended for GCM)
  keyDerivation: {
    saltBytes: 16,
    iterations: 100_000,
    hash: 'sha256',
    keyLen: 32,             // 256‑bit key
  },
  emojiMap: DEFAULT_EMOJI_MAP, // first 256 single‑grapheme emojis
};

configure() simply does:

module.exports.configure = (overrides = {}) =>
  class EmojiCryptoCustom extends EmojiCrypto {
    static CONFIG = deepMerge(DEFAULT, overrides);
  };

📚 API Reference

| Method | Description | | -------------------------------------------- | ------------------------------------------------------------------------------------------- | | `new EmojiCrypto(password | key[, options])` | | encrypt(plaintext[, encoding]) | Returns emoji string. Optionalencoding(utf8/hex/b64) treated as plaintext input encoding. | | decrypt(emojiCiphertext[, outputEncoding]) | Returns decrypted text (defaultutf8). | | static configure(overrides) | Preferredhelper to produce a tailored subclass. |

🔬 How it works

  1. Derive key — PBKDF2‑SHA‑256 → 256‑bit key (configurable iterations/salt length).
  2. Encrypt — AES‑256‑GCM with random IV (12 bytes by default).
  3. Map bytes → emojis — Each ciphertext byte (0‑255) indexes into the 256‑emoji map.
  4. Append auth tag & IV — Also converted to emoji and concatenated.

Because emojis are multibyte UTF‑8 characters, ciphertext expands ~4× in size, but stays printable, share‑friendly, and—most importantly—fun.

🖼 Choosing a custom emoji map

  • Exactly 256 distinct single‑grapheme emojis.
  • Avoid skin‑tone variants and multi‑character sequences (flags, ❤️‍🔥, etc.).
  • Check with the supplied helper:
import { validateEmojiSet } from 'emoji-crypto/tools';
validateEmojiSet(my256EmojiArray); // throws if not valid

📝 License

This project is licensed under the MIT License