Skip to content

Cordova plugin that provides an interface to native PBKDF2 implementations on iOS and Android

Notifications You must be signed in to change notification settings

padloc/cordova-plugin-pbkdf2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

PBKDF2 Cordova Plugin

This plugin provides a javascript interface for native implementations of the PBKDF2 algorithm on iOS and Android.

The iOS implementation uses the CommonCrypto module while the Android implemenation uses https://github.com/m9aertner/PBKDF2

Installation

Simply add through the cordova cli:

cordova plugin add cordova-plugin-pbkdf2

Usage

The plugin adds the pbkdf2 function to the global scope:

pbkdf2(
    "password", // the password
    "X1oXfKeBOw08ahdSFjeP2Q==", // Base64-encoded salt
    {
        iterations: 100000, // number of iterations to be used (default: 10000)
        keySize: 512, // desired key size (supported values: 256, 512, default: 256)
    },
    (key) => console.log(key), // Success callback. Single argument is the Base64-encoded derived key
    (err) => console.error(err), // Error callback
);

The function also returns a promise if the Promise constructor is found. Otherwise it returns undefined.

About

Cordova plugin that provides an interface to native PBKDF2 implementations on iOS and Android

Resources

Stars

Watchers

Forks

Packages

No packages published