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 🙏

© 2024 – Pkg Stats / Ryan Hefner

giselle

v3.1.0

Published

Giselle cipher, is a symetric key cipher, based on the XOR, base conversion, Scrypt & One Time Pad algorithm.

Downloads

21

Readme

Giselle v3.0.0

Giselle cipher, is a symetric key cipher, based on the XOR, base conversion, Scrypt & One Time Pad algorithm.

Supports the Elliptic-curve Diffie–Hellman (ECDH) key agreement protocol.

Supports the usage of emojis inside the passwords/messages (or any other high level characters...).

How the algorithm encrypts messages?

  1. Padding.

  2. UTF-8 encoding.

  3. Binary conversion.

  4. Salt generation.

  5. XOR (salt + message).

  6. Loop of Key expansions & XOR (expansion using Scrypt).

  7. Hex conversion.

  8. Return ciphertext with salt (seperated with ":").

The algorithm decrypts the ciphertext, using the same steps, flipped & in reversed order.

An example without ECDH

// Import this package

import { Encrypt, Decrypt } from "giselle"; // or: const { Encrypt, Decrypt } = await import("giselle");

// Select a password
const password = "gt785fy54dt897rgV#Yf3f98ktu9803xdj,9$#Y$#^TV%$GTB";

// Select a message to encrypt
const message = "Hello there! my name is Yaroni Makaroni! You have a good taste in choosing npm libraries :)";

// Power level / Cipher strength (any positive integer, 1 or above)
const strength = 1;
// 1 is the default, it may take some time to encrypt/decrypt using strength above 1 !

// Encrypt
const ciphertext = Encrypt(password, message, strength);

// Decrypt
const plaintext = Decrypt(password, ciphertext, strength);

// "Hello there! my name is Yaroni Makaroni! You have a good taste in choosing npm libraries :)"
console.log(plaintext);

An example with ECDH

// Import this package

import { Curve } from "giselle"; // or: const { Curve } = await import("giselle");

// First friend:
const curve = new Curve();
curve.init();

// Second friend:
const curve = new Curve();
curve.init();

// Now they need to publish their curve.public.x & curve.public.y .
// After that, each one of them need to insert the other friend's public X & Y...

curve.x(<publicX>);
curve.y(<publicY>);

// Now, let's talk! :)

// First friend:
curve.msg("I need help! SOS! I can't finish all that ice cream alone!!");
const iceCreamEmergencyCall = curve.enc();

// First friend send the encrypted message to the second friend.
// But without the ability to send the password, with their unsafe internet connection...
// How would the original message will be decrypted?
// Well... it could be decrypted easily!
// Their secrets are already the same :)
// If you do not believe, run: `console.log(curve.secret)` for both of the friends - the secret.x & secret.y should be equal.

// Second friend:
curve.msg( iceCreamEmergencyCall );
const decryptedSos = curve.dec();

console.log( decryptedSos );
// I need help! SOS! I can't finish all that ice cream alone!!

Scrypt implementation from scrypt-js.

License

This project is licensed under MIT open-source license.