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

aif-cipher

v0.0.4

Published

A set of basic AES implementation functions aes-256-cbc for encryption and decryption of data packets that can be used to send information to servers compatible with openssl libraries.

Downloads

3

Readme

aif-cipher

Implementation of aes-256-cbc, base64, and md5

A set of basic AES implementation functions aes-256-cbc for encryption and decryption of data packets that can be used to send information to servers compatible with openssl libraries.

Installation

Download the library with npm / Yarn, from your local files.

Via NPM:

$ npm install aif-cipher

Via YARN:

$ yarn add aif-cipher

Or you can export to the browser, using one of these tools: [Browserify] (http://browserify.org/), [Webmake] (https://github.com/medikoo/modules-webmake) o [Webpack] (http://webpack.github.io/)

Use

The library can be included in your code through imports from CommonJS or ES.

ES2015 (ES6):

import * as cipher from "aif-cipher";

CommonJS:

var cipher = require("aif-cipher");

With ES imports it is also possible to use individual components. For example:

import { aesEncode, aesDecode, md5 } from "aif-cipher";

Configuración

The initialization of the credentials is optional, since if it is not defined from here, the encryption methods can be passed directly to the arguments.

var cipher = require("aif-cipher");

var secret = '-secret-';
var token = cipher.md5('-token-');

cipher.aesSetCredentials(secret, token);

if ** Token ** is set, it must be 32 characters.

Methods

md5(string)

base64Encode(data)

base64Decode(data)

aesSetCredentials([secret], [token])

aesDecode(string, [secret], [token])

aesEncode(string, [secret], [token])

Example using the credential definition:

var cipher = require("aif-cipher");

var hash = cipher.md5('-valor-');
console.log('md5:', hash);

var data = cipher.aesEncode('-valor-', '-secret-', cipher.md5('-token-'));
console.log('encode:', data)

data = cipher.aesDecode(data, '-secret-', cipher.md5('-token-'));
console.log('decode:', data)

Example using the credential definition:

var cipher = require("aif-cipher");

var secret = '-secret-';
var token = cipher.md5('-token-');
cipher.aesSetCredentials(secret, token);

var data = cipher.aesEncode('-valor-');
console.log('encode:', data)

data = cipher.aesDecode(data);
console.log('decode:', data)

Tests

$ npm test

O well

$ yarn test

build

$ npm run build

O well

$ yarn build

Security contact information

To report security vulnerabilities, use the following link: https://github.com/mygnet/aif-cipher/issues