Skip to content
This repository has been archived by the owner on Sep 13, 2021. It is now read-only.

Latest commit

 

History

History
executable file
·
70 lines (41 loc) · 1.63 KB

keymakers.md

File metadata and controls

executable file
·
70 lines (41 loc) · 1.63 KB

<< back to the Securely main page

BenCoding.Securely

The key generation methods are available at the root of the securely module.

Getting Started

* First you need to download and install the module as discussed [here.](https://github.com/benbahrenburg/Securely) * You can now use the module via the commonJS require method, example shown below.

var securely = require('bencoding.securely');

Requiring Securely into your project

Requiring the module into your project


//Require the securely module into your project
var securely = require('bencoding.securely');

Methods

generateDerivedKey

The generateDerivedKey method takes an input string and uses this string as a seed to generate a derived key. This key then can be used as a password or key for later encryption method.

Arguments

The generateDerivedKey method takes the following arguments ( order is important ).

1. String - (required) String to be used as the derived key's seed value.

Return value String

Example



var usingGUID = securely.generateDerivedKey(Ti.Platform.createUUID());	
Ti.API.info("Derived key using GUID = " + usingGUID);


generateRandomKey

The generateRandomKey method generates a randomly generated key. This key then can be used as a password or key for later encryption method.

Arguments None

Return value String

Example



var randomKey = securely.generateRandomKey();
Ti.API.info("Random Key = " + randomKey);