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

@control/sign

v0.0.4

Published

A simple sign/verify - encrypt/decrypt package that uses SSH RSA keys

Downloads

1

Readme

This is a very simple utility to sign or encrypt files or random input with an RSA key pair.

Signing with a keypair allows you to broadcast your public key and transmit digital signatures so other people can trust whatever content you sent was not tampered with.

Encrypting is used the other way around, you are supposed to encrypt a file using someone else's public key, so they can decrypt it using their private key. Since RSA cannot encrypt too much data, this package creates a random 32 char password that it uses to perform the encryption. This password is then encrypted via RSA and sent along with the encrypted file. Anyone else who receives the file should need the receipients private RSA key to decrypt the password, and thus the file.

Keys

By default @control/sign uses your default id_rsa key from your .ssh folder. You can of course specify any other key if needed.

Please note that the keys (both private and public) must be in pem format.

Usually your public RSA key would be generated for SSH, and should be in ssh-rsa format.

In order to export your public RSA key into pem format you can use the following command:

ssh-keygen -f my_key.pub -e -m pem > my_key.pub.pem

GitHub sharing keys

GitHub automatically shares your public keys with the world, just head over to github.com/:username.keys, for example my public key is located at github.com/jsmrcaga.keys.

Usage

Installation

npm i -g @control/sign

Common arguments

| Argument | Required | Default value | Description | |:-:|:-:|:-:|:-:| | -i, --input | No | - | The input to sign/verify | | -k, --key | No | ~/.ssh/id_rsa for private keys, ~/.ssh/id_rsa.pub.pem for pubic keys | The public key used to verify, or private key used to sign | | -f, --format | No | 'base64' | The format used to export the signature |

Signing

Signing input:

sign -i <my input>

Signing a file:

sign my_file.ext

exporting :

sign -o my.signature my_file.ext

Verifying

verify -s <signature.file> file-to-verify.ext

Encrypting

encrypt -o file.encrypted -k bobs-public-key.pem file.txt

Decrypting

decrypt file.encrypted

To a file

decrypt -o file.txt file.encrypted
decrypt file.encrypted > file.txt