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

node-bury

v1.0.1

Published

A cryptographic and steganographic image library for nodejs.

Downloads

3

Readme

#Bury

A cryptographic and steganographic image library for nodejs.

========================

 ,ggggggggggg,   ,ggg,         gg  ,ggggggggggg,    ,ggg,         gg
dP"""88""""""Y8,dP""Y8a        88 dP"""88""""""Y8, dP""Y8a        88
Yb,  88      `8bYb, `88        88 Yb,  88      `8b Yb, `88        88
 `"  88      ,8P `"  88        88  `"  88      ,8P  `"  88        88
     88aaaad8P"      88        88      88aaaad8P"       88        88
     88""""Y8ba      88        88      88""""Yb,        88        88
     88      `8b     88        88      88     "8b       88       ,88
     88      ,8P     88        88      88      `8i      Y8b,___,d888
     88_____,d8'     Y8b,____,d88,     88       Yb,      "Y88888P"88,
    88888888P"        "Y888888P"Y8     88        Y8           ,ad8888
                                                             d8P" 88
                                                           ,d8'   88
                                                           d8'    88
                                                           88     88
                                                           Y8,_ _,88
                                                            "Y888P"

A nodejs port of BuriedUnderTheNoiseFloor.

Write up is at my blog.

If anyone is feeling generous, my bitcoin address is 17da1aqXEhdqMkbEq66nc2n5DeAnrnNbsK. Donations help me justify spending time on my computer to my wife. :-)

Comments and issues posted on github will be answered. Pull-requests are always welcome if you've fixed or enhanced something.


Installation

git clone https://github.com/jspark311/node-bury.git
cd node-bury
npm install bury

Usage

Encrypting
var Bury = require('bury');

var options = {
  enableRed:      true,
  enableGreen:    true,
  enableBlue:     true,
  visibleResult:  false,
  rescaleCarrier: true
};

var test_image = new Bury('./test_carrier.jpg', 'saddroPs', options);

var msg = 'This is a silly test message that the NSA will spend millions of dollars to unearth.'
test_image.setMessage(msg);
test_image.outputImage('./test_carrier.png');
Decrypting
var Bury = require('bury');

var test_readback = new Bury('./test_carrier.png', 'saddroPs');
console.log(test_readback.getMessage());
Testing passwords for mutual compatibility
var Bury = require('bury');

// testPasswordCompatibility() returns 'true' if the provided passwords are mutually compatible.
//   'false' otherwise. The function requires at least two passwords. Maximum of three, because we
//   can only have (at maximum) three independent channels.

console.log('Are these passwords compatible? ' + 
  Bury.testPasswordCompatibility('key_for_steg-img.php', 'key_for_form.php'));

console.log('Are these passwords compatible? ' + 
  Bury.testPasswordCompatibility('one-of-thess-passwords', 'is-not-mutally', 'compatible'));

Compatibility note

The carriers produced by this code will not inter-operate with those produced with the PHP version, and vice-versa. The only reason for this is that the default PRNG in PHP was able to be seeded, and the one in node is not. This might not be a problem, as I at least had enough foresight to bake a version field into the header in the original. So I have incremented this value for the JS code.

This problem may be resolvable by changing the PHP code to use the same mersenne twister algorithm used here. But I doubt that this is going to cause anyone enough grief to care.

Just sayin'...

TODO

  • Compression is broken at the moment.

  • File-embedding is untested.

  • The control-flow that this code inherited from the PHP original feels awful in JS. There are too many synchronous operations and arbitrary branching. Need to impart a more functional style to it.

  • There is presently no enforcement of "one instance, one operation". Risks obtuse crypto bugs caused by crufty IVs and seeded RNGs from prior operations.

  • It would be nice to be able to automatically write output files if such-and-such an option parameter is passed in at instantiation. The same goes for encrypting.

  • Decrypting can (in principle) be done automatically. With nothing more than the carrier and a password, a header can be discovered and the data retrieved. But, at present, you must make a separate function call.

  • Write unit tests. Should be easy to do, since the criteria for success is unambiguous.



License is MIT, so be free.

---J. Ian Lindsay