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

secure-caesar

v9.0.0

Published

secure-caesar cipher, is a symetric key cipher, based on caesar shift cipher. Enhanced with unicode support, custom padding, Scrypt key expander, elliptic curve support & power usage selection.

Downloads

22

Readme

secure-caesar v9.0.0

Made with much screen time & care for the community, by: Yaron Koresh, Israel.

This project is licensed under MIT open-source license.

Notice: credits for the Scrypt algorithm implementation, belong to Richard Moore, the author of scrypt-js. I couldn't use it externally as a CommonJS inside my ESModule project.

secure-caesar cipher, is a symetric key cipher, based on caesar shift cipher.

  • Unicode support.

  • Message padding.

  • Secure random salt, generated with each encryption.

  • ECDH support.

Example without ECDH

// Import this package

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

// 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 :)";

// 1 or above is the amount of power usage needed by the encryption & decryption (the last parameter)
const powerUsage = 2;

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

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

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

Example with ECDH

// Import this package

import { Curve } from "secure-caesar"; // or: const { Curve } = await import("secure-caesar");

// 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!!

Enjoy!