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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cryptia

v1.1.0

Published

Cryptia is a simple JavaScript library for encrypting and decrypting text using a basic substitution cipher. It provides an easy-to-use interface for securing text data in client-side applications..

Downloads

159

Readme

🛠 Usage

CryptiaJS 🔐 CryptiaJS is a powerful and secure JavaScript library for encrypting and decrypting text and files using advanced encryption algorithms. Whether you're safeguarding sensitive data in web applications or adding encryption to your server-side projects, CryptiaJS is designed to be fast, reliable, and easy to use. ⚡

Your data stays protected—as long as you keep your encryption key private.

🚀 Installation

Install CryptiaJS via npm:

npm i cryptia

Or clone the GitHub repository:

git clone https://github.com/chukwunonsoprosper/cryptia
cd cryptia

Testing the Library

To test the library, run:

npm run test

Customizable Workspace

To spin up a customizable workspace, run:

npm run dev

You can also link workspace.js to your project directory to integrate CryptiaJS easily.

Example

/**
 * Import Cryptia and required dependencies.
 */
import Cryptia from '../cryptia.js'

// Initialize Cryptia with custom settings.
const cryptia = Cryptia({
    obfuscationLevel: 10,
    logging: false,
    preserveWhitespace: true
});

/**
 * Encrypt and decrypt text with a secure key.
 */
const plainText = 'This is a secret message.🤣😂';
const encryptionKey = 'MySecureKey1';

const encryptedResult = cryptia.encrypt(plainText, encryptionKey)
console.log('Encrypted Text:', encryptedResult.data);

const decryptedResult = cryptia.decrypt(encryptedResult.data, encryptionKey)
console.log('Decrypted Text:', decryptedResult.data);


// Encrypt a file
const fileEncryptResult = cryptia.encryptFile(
  '/path/to/file.txt',
  'secretKey',
  null,  // Callback function (optional)
  'output.encrypted'  // Output filename (optional)
);
console.log(`File encrypted to: ${fileEncryptResult.encryptedFilePath}`);

// Decrypt a file
const fileDecryptResult = cryptia.decryptFile(
  'output.encrypted',
  'secretKey',
  null,  // Callback function (optional)
  'decrypted_output.txt'  // Output filename (optional)
);
console.log(`File decrypted to: ${fileDecryptResult.decryptedFilePath}`);

🔥 What's New in v1.0.6?

  • ✅ Binary Data Encryption - Support for images, PDFs and other binary files
  • ✅ Large File Streaming - Process large files without memory limitations
  • ✅ Progress Tracking - Monitor encryption/decryption progress in real-time
  • ✅ Key Strength Verification - Built-in security checks for encryption keys
  • ✅ Command Line Interface - Encrypt/decrypt directly from the terminal
  • ✅ Stronger security – Your encrypted data stays safe as long as your encryption key remains private
  • ✅ Better performance – Optimized for speed and efficiency
  • ✅ Cleaner code – More maintainable and readable
  • ✅ Improved documentation – Making integration smoother than ever

Binary Data Encryption

// Encrypt binary data (like an image)
const imageBuffer = fs.readFileSync('image.png');
const encryptedBinary = cryptia.encryptBinary(imageBuffer, 'secretKey');
fs.writeFileSync('encrypted.bin', encryptedBinary.data);

// Decrypt binary data
const encryptedData = fs.readFileSync('encrypted.bin', 'utf-8');
const decryptedBinary = cryptia.decryptBinary(encryptedData, 'secretKey');
fs.writeFileSync('decrypted.png', decryptedBinary.data);

// Encrypt a large file using streams
await cryptia.encryptLargeFile(
  '/path/to/large-file.mp4',
  '/path/to/output-encrypted.bin',
  'secretKey'
);

// Decrypt a large file using streams
await cryptia.decryptLargeFile(
  '/path/to/output-encrypted.bin',
  '/path/to/recovered-file.mp4',
  'secretKey'
);

Install CLI globally

npm install -g cryptia

CLI Examples

# Encrypt text
cryptia encrypt --text "Secret message" --key "mySecretKey"

# Decrypt text
cryptia decrypt --text "ENCRYPTED_TEXT" --key "mySecretKey"

# Encrypt file
cryptia encrypt --file "/path/to/file.txt" --key "mySecretKey"

# Decrypt file
cryptia decrypt --file "/path/to/file.encrypted" --key "mySecretKey"