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

evilcrypt

v0.2.3

Published

Collection of symmetric encryption algorithms.

Readme

evilcrypt

npm version License: MIT

EvilCrypt is a collection of symmetric encryption algorithms that extend AES. Each algorithm version offers different parameters, such as key length, checksum length, or encryption speed, to suit various use cases.

Getting started

You can install the package using your preferred package manager:

bun install evilcrypt
# or
pnpm install evilcrypt
# or
npm install evilcrypt

To encrypt and decrypt a string, follow this example:

import { randomBytes } from 'node:crypto';
import {
    encrypt,
    decrypt,
} from 'evilcrypt';

const message = 'Hello world!';
const message_buffer = Buffer.from(message, 'utf8');

const key = randomBytes(64);

const message_encrypted = await encrypt(message_buffer, key);
console.log(message_encrypted);
// Buffer(65) [Uint8Array] [
//     1, 234, 250,  99, 214,  36, 216,  43,  65,  68,  85,
//    20,   8,   3, 152, 234, 206, 228,  14, 184, 101,  62,
//   132, 217,  56, 131, 167,  87, 112, 128,  87, 242,  39,
//   249,  12, 190, 100,  87,  91, 145,  49, 112,  51,  96,
//     7,  23, 181, 182, 210, 171, 244, 220,  98, 163, 207,
//    86,  78, 139,  26, 176, 238,  48,  44,  77,  20
// ]

const message_decrypted = await decrypt(message_encrypted, key);
console.log(message_decrypted.toString('utf8'));
// 'Hello world!'

By default, the encrypt method uses algorithm v1. If you want to use a different algorithm, call the encrypt method of that specific version:

import { v2 as evilcrypt_v2 } from 'evilcrypt';

const message_encrypted = await evilcrypt_v2.encrypt(message_buffer, key);

For decryption, use the decrypt method from the core module. It automatically detects the algorithm used to encrypt the message.

import { decrypt } from 'evilcrypt';

const message = await decrypt(message_encrypted, key);

Algorithms

v1

| Parameter | Value | | ------------------ | ------------- | | AES algorithm | AES-256-CBC | | PBKDF2 algorithm | PBKDF2-SHA256 | | PBKDF2 iterations | 100 000 | | Message padding length | 8...255 bytes | | Checksum algorithm | SHA256 | | Checksum length | 32 bytes | | Key length | 64 bytes |

v1 is inspired by Telegram’s MTProto encryption. Its output is relatively long because it includes a 32-byte checksum and extensive padding. This makes it less suitable for encrypting short messages.

v2

| Parameter | Value | | -------------------------- | -------------------- | | AES algorithm | AES-256-CBC | | PBKDF2 algorithm | PBKDF2-SHA256 | | PBKDF2 iterations | 100 000 | | Message padding length | 6 bits + 4...7 bytes | | Checksum algorithm | PBKDF2-SHA256 | | Checksum PBKDF2 iterations | 100 000 | | Checksum length | 12 bytes | | Key length | 64 bytes |

v2 is optimized for encrypting short messages, such as tokens. It produces shorter outputs compared to v1 due to its reduced checksum length. However, the checksum is computed using PBKDF2 with 100 000 iterations, making brute-force attempts more difficult. The padding length is also minimized, with a maximum length of 62 bits.