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

message-cipher

v1.0.0

Published

An exploration of node's crypto Private/Public key algorithms.

Downloads

3

Readme

Message Cipher

An exploration of node's crypto Private/Public key algorithms.

Installing globally provides binary: msg-cipher

Install

nvm use 5 # works best if run with node 5x
npm install

Generate a new private key file

node index.js generate

Force-regenerate private key file

node index.js generate -f

Generate private key and dump to output

node index.js generate -R

Read info about current private key file

node index.js read

Encrypt a message

node index.js encrypt [--priv <private-key>] [--pub <public-key>] <msg>

Decrypt a message

node index.js decrypt [--priv <private-key>] [--pub <public-key>] <encrypted-msg>

Encrypting message to other user

node index.js encrypt [--priv <sender-private-key>] --pub <receiver-public-key> <msg>

Decrypting message sent by sender to other user

node index.js decrypt [--priv <sender-private-key>] --pub <receiver-public-key> <encrypted-msg>

Decrypting message from other user

node index.js decrypt [--priv <receiver-private-key>] --pub <sender-public-key> <encrypted-msg>

Example Script

export MY_PRI="03ed57857b42c69bf0559087d748d78a83f011d1459274c8f09f0ae3afe25d70f75f83684dbf46b959cf2a403580f5fbf347e18515cd47e9e27c07e87e1ddf74b908477337e5f7ef"
export MY_PUB="0406baf5bd0db574d342fba3e53619a931652e6f8088c7f415b6af7ee191c1bddb571c4fe2a4ccb61aec940079a4424ef5fc4d222ab3fca22e0d5721511eebfe607820536642a3c71d02f84661b744a890cb8778e145803560ab04b69ee71a8e61b90a4ce3fde92c15e5d54d76e048bbd712475f0a772505acb9458c9d7e8e14c5e6466f937837b11cacfbf55e0def2753"

export TEST_PRI="9f6ba49209d617402b5459f33c2b2f56edcdeb8f021242e2ec54916b9a5485cc6e4852c5061037d14f9ddbbfc8a34638f1730094faffb1a0508a7872eb32fd5d1c40d1b516890c"
export TEST_PUB="0404832e0a1ba719ed3ae03ba86e356fd1d3bc8df89d824cbd5bdd89439bcf45aae2c65e0f6af0d340638776545ad69fe7fbe948f1d3ad02ef6c94b52b274482e49d14b5d575c423be01df7252962db72c99e3b4c18c87e9f25f16bcbcfde371ca784d0ff2be1697ff96369ff8a9172f0045f30ae90f79c0bea47b51efe1a8ede05a698abb51c58a7494dba9bc3dfef79f"

node index.js encrypt --priv $MY_PRI --pub $TEST_PUB "This is a test"

# Outputs >>
# Encrypted Message:
# 1bc089d5d64e87f2c6d1aaf170fc8330a8630eeb85dcb262b30ee465e179749e8616e4192d8acf124335f34bb49e16ac6543f36905dd9ab478bb30f57f2bc6bfd8da326c6704c1335f4611d96e

node index.js decrypt --priv $MY_PRI --pub $TEST_PUB 1bc089d5d64e87f2c6d1aaf170fc8330a8630eeb85dcb262b30ee465e179749e8616e4192d8acf124335f34bb49e16ac6543f36905dd9ab478bb30f57f2bc6bfd8da326c6704c1335f4611d96e

# Outputs >>
# Decrypted Message ("2016-05-02T23:38:53.936Z"):
# This is a test

node index.js decrypt --priv $TEST_PRI --pub $MY_PUB 1bc089d5d64e87f2c6d1aaf170fc8330a8630eeb85dcb262b30ee465e179749e8616e4192d8acf124335f34bb49e16ac6543f36905dd9ab478bb30f57f2bc6bfd8da326c6704c1335f4611d96e

# Outputs >>
# Decrypted Message ("2016-05-02T23:38:53.936Z"):
# This is a test