<< back to the Securely main page
BenCoding.Securely
The key generation methods are available at the root of the securely module.
* 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 the module into your project
//Require the securely module into your project
var securely = require('bencoding.securely');
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);
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);