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

aerogear-cordova-crypto

v0.0.4

Published

This plugin mimics the API of the aerogear-js crypto functions as close as possible, but delegates the work to the native implementations

Downloads

3

Readme

AeroGear Crypto Plugin

| | Project Info | | --------------- | ------------- | | License: | Apache License, Version 2.0 | | Build: | Cordova Plugin | | Documentation: | https://aerogear.org/docs/specs/aerogear-cordova/ | | Issue tracker: | https://issues.jboss.org/browse/AGCORDOVA | | Mailing lists: | aerogear-users (subscribe) | | | aerogear-dev (subscribe) |

This plugin allows you to use the native aerogear crypto libs for your cordova apps. While staying close to the aerogear-js api.

  • Password based key derivation support
var agCrypto = new AeroGear.Crypto();
agCrypto.deriveKey('my password', null, {
    success: function (rawPassword) {
        console.log(rawPassword);
    }
});
  • Symmetric encryption support

    • Encryption:
Promise.all([agCrypto.deriveKey('my password'), agCrypto.getRandomValue()])
    .then(function (rawPassword, IV) {
            var options = {
                IV: IV[0],
                key: rawPassword[0],
                data: "My Bonnie lies over the ocean, my Bonnie lies over the sea"
            };
            agCrypto.encrypt(options).then(function (cipherText) {
                console.log(cipherText);
            });
        },
        function (error) {
            console.log('error ' + error);
        });

// or with regular callbacks

agCrypto.deriveKey('my password', null, {
    success: function (rawPassword) {
        agCrypto.getRandomValue({
            success: function (generatedIV) {
                var options = {
                    IV: generatedIV,
                    key: rawPassword,
                    data: "My Bonnie lies over the ocean, my Bonnie lies over the sea"
                };
                agCrypto.encrypt(options, {
                    success: function (cipherText) {
                        console.log(cipherText);
                    }
                });
            }
        });
    }
});
  • Decryption:
var options = {
    IV: "69696ee955b62b73cd62bda875fc73d68219e0036b7a0b37",
    AAD: "feedfacedeadbeeffeedfacedeadbeefabaddad2",
    key: rawPassword,
    data: cipherText
};
AeroGear.Crypto().decrypt(options, {
    success: function (text) {
        console.log(text);
    }
});
  • Asymmetric encryption support / iOS not supported
Promise.all([agCrypto.KeyPair(), agCrypto.KeyPair(), agCrypto.getRandomValue()])
    .then(function (keyPair, keyPairPandora, IV) {
        var options = {
            IV: IV[0],
            key: new agCrypto.KeyPair(keyPair[0].privateKey, keyPairPandora[0].publicKey),
            data: "My bonnie lies over the ocean"
        };
        agCrypto.encrypt(options).then(function (cipherText) {
            options.key = new agCrypto.KeyPair(keyPairPandora[0].privateKey, keyPair[0].publicKey);
            options.data = cipherText;
            agCrypto.decrypt(options).then(function (plainText) {
                console.log('plainText ' + plainText);
            });
        });

    });

Installing

cordova plugin add org.jboss.aerogear.cordova.crypto

For now, only iOS and Android are supported

iOS

cordova platform add ios
cd platforms/ios
pod install

Android

cordova platform add android

Run tests

  1. Use your existing cordova app, or create a new one.
  2. Add the plugin and the tests:
cordova plugin add https://github.com/aerogear/aerogear-cordova-crypto.git
cordova plugin add https://github.com/aerogear/aerogear-cordova-crypto.git#:/tests
  1. Add this plugin:
cordova plugin add http://git-wip-us.apache.org/repos/asf/cordova-plugin-test-framework.git
  1. Change the start page in config.xml with <content src="cdvtests/index.html" /> or navigate to cdvtests/index.html from within your app.

Documentation

For more details about the current release, please consult our documentation.

Development

If you would like to help develop AeroGear you can join our developer's mailing list, join #aerogear on Freenode, or shout at us on Twitter @aerogears.

Also takes some time and skim the contributor guide

Questions?

Join our user mailing list for any questions or help! We really hope you enjoy app development with AeroGear!

Found a bug?

If you found a bug please create a ticket for us on Jira with some steps to reproduce it.