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

uglycry

v1.3.3

Published

A small dependencyless library that provides only a special class for encrypting and decrypting arbitrary files using PNG images as cryptographic keys in place of typical password strings. It provides both AES-GCM and Vigenère encryption/decription method

Downloads

11

Readme

UglyCry

UglyCry is a micro-library that provides only a special class for encrypting and decrypting arbitrary files using PNG images as cryptographic keys in place of typical password strings.

It supports two encryption modes:

- AES-GCM (256-bit) — secure, modern browser-native cryptography
- Vigenère cipher — simple, educational, intentionally weak

No key derivation is performed, the entire PNG’s full binary data is used as the key material itself.

UglyCry can optionally apply 32 reversible obfuscation layers using multiple (16, chance of ~x3 each) data-scrambling functions. This layer sequence is generated from the png's hash (deterministic and reversible).

It works entirely client-side, accepting input from (given key input is valid PNG):

- File objects
- <input type="file"> elements
- DOM elements that expose .files[0]
- Data URLs previously produced by UglyCry itself 

No server environment required.

Provides - UglyData class:

Construction:

new UglyData(processVigenere, obfuscateFingerprint, reportLogs);

Construction arguments:

(bool) processVigenere - If true, sets the encryption method to fbe a simple and insecure Vigenere cipher encryption. Otherwise, uses the standard AES-GCM encryption method.

(bool) obfuscateFingerprint - If true, sets the obfuscation layering process to run after encryption, and to reverse the layers before decryption. Otherwise, skip that part of the process.

(bool) reportLogs - If true, console.log() the package's functions at each and every step of the processes for easy testing.


Provides public fields:

- keyName [string] 
 > name of the file used as the key. 
 > Can be set using the loadKey(element) method.

- keyHash [string] 
 > a 32-character (128-bit) non-cryptographic hash derived from the PNG key, used for generating obfuscation-layer order. 
 > Can be set using the loadKey(element) method.

- keyBlob [string] 
 > string containing the blob of data from the key's loaded file. 
 > Can be set using the loadKey(element) method.

- subjectName [string] 
 > name of the file used as the subject. 
 > Can be set using the loadSubject(element) method.

- subjectBlob [string] 
 > string containing the blob of data from the subject's loaded file.
 > Can be set using the loadSubject(element) method.

Provides public methods:

- loadKey(elementOrObject)  
 > Loads the PNG key used as the cryptographic key (File/DOM).
 > Stores the file name under keyName and DataURL data under keyBlob before 
 hashing the key and storing that in keyHash.

- loadSubject(elementOrObject) 
 > Loads the file subject to encryption or decryption (File/DOM).
 > Stores the file name under subjectName and its data under subjectBlob 
 (as either plaintext or a DataURL data depending on if it's a .ugly file).

- processUgly(isDecryption) - returns the [File] result of running a cipher 
on subjectBlob using keyBlob.
 > If this object's obfuscateFingerprint = true, 
    also runs through the obfuscation process.
 > If this object's processVigenere = true, 
    runs using the vigenere cipher. 
    Otherwise, runs using the AES-GCM cipher.
 > If isDecryption= true, decrypt. 
    Otherwise, encrypt.

Example Usage:

import UglyData from 'uglycry';

let vigenereMode = false;
let obfuscateFingerprint = true;

let printUcLogs = true;

console.log("Creating UglyData instance for AES encryption with obfuscation...");
const ucAesObfuscate = new UglyData(vigenereMode, obfuscateFingerprint, printUcLogs);

console.log("Loading images for encryption/decryption...");
await ucAesObfuscate.loadKey(document.getElementById('keyInput'));
await ucAesObfuscate.loadSubject(document.getElementById('subjectInput'));

console.log("Encrypting...");
const encryptedFile = await ucAesObfuscate.processUgly(false);
console.log("Encrypted file:", encryptedFile);

console.log("Decrypting...");
const decryptedFile = await ucAesObfuscate.processUgly(true);
console.log("Decrypted file:", decryptedFile);