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

ncryptify

v0.0.6

Published

node.js client for ncryptify service

Downloads

5

Readme

NCryptify Client node.js Library

This node.js library provides access to the ncryptify service. The ncryptify service offers key management as a service, and specialised cryptography such as format preserving encryption as a service. Visit www.ncryptify.com for more information.

Features

  • Hide/Unhide digital, alphanumeric, or plain printable text while preserving format using the ncryptify crypto service.
  • Create and retrieve cryptographic keys using the ncryptify key management service. These retrieved keys can subsequently be used to perform the cryptographic operations enumerated below.
  • Encrypt and decrypt buffers (also called blobs) using local encryption provided by the node.js crypto library.
  • Encrypt and decrypt files using local encryption provided by the node.js crypto library.

Installation

To install this module for use within node.js applications, use the following npm install command.

$ npm install ncryptify

Note: ncryptify requires node v4.2.2 or higher.

Documentation

API Documentation can be found in doc/index.html. You can always regenerate the documentation using grunt jsdoc.

Get a client ID and client secret

Go to https://devportal.ncryptify.com/ and get a client id and secret. You can do this by creating a new application. Note down the client ID and client secret for the app after it has been created.

Play with it

var ncryptify = require('ncryptify');
...

var HideParams = {keyName: "phone-number", hint: "digit"};
 
var ncryptifyClient = new ncryptify.Client(CLIENT_ID, CLIENT_SECRET, CLIENT_ISSUER, 5, "[email protected]");
ncryptifyClient.hide("555-123-4567", HideParams).then(function(value) {
    console.log("ncryptified number is " + value);
});

The CLIENT_ID and CLIENT_SECRET are the ones obtained from the developer portal as discussed above. The CLIENT_ISSUER can be any string you want.

Browser Version

Ncryptify can also be used in browsers. The browserified version is available in the scripts directory.

After making the changes to the library, execute the following command to apply the changes to the browser version.

npm run browserify-minify

This would create browserified and minified version of the library. The following files would be created as a result.

/scripts/browser-ncryptify.js
/scripts/browser-ncryptify.min.js
/examples/formfiller/public/scripts/browser-ncryptify.min.js

These files have to be manually committed.

Testing

The tests can be run from the root directory ('npm test' or 'mocha'). The tests require a client ID and secret. The environment variables, NCRYPTIFY_ID and NCRYPTIFY_SECRET, can be used to pass the client ID and client secret to the tests. These variables should be initialized using the client ID and secret obtained from the developer portal as follows:

NCRYPTIFY_ID=<client-id>
NCRYPTIFY_SECRET=<client-secret>

Add the environment variable NCRYPTIFY_HTTP_PROXY to setup HTTP proxy.

NCRYPTIFY_HTTP_PROXY=<http-proxy-url>

The tests use the dotenv module so if you wish you can place these values in the root directory of the project, in .env file, and the tests will pick them up.

Examples

Demonstrated uses of this module and ncryptify services can be found in the examples directory.

The client ID and client secret are used by the example applications. The formfiller application, located in the examples/formfiller directory, needs a client ID and a client secret. The client ID and secret can be passed to the application using environment variables as discussed previously. One could create a file named .env in the examples/formfiller directory and set the NCRYPTIFY_ID and NCRYPTIFY_SECRET variables to the client ID and secret, respectively, in that file.

License

MIT