Skip to content

bealearts/secure-storage-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

46 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

secure-storage-js Build Status Dependency Status

Pure JS implementation of SecureStorage API as inspired by http://www.nczonline.net/blog/2010/04/13/towards-more-secure-client-side-data-storage/

Allows the secure storage of client side data within the browser

Encryption provided by Stanford Javascript Crypto Library

browser support

Example Usage

/**
 *	Full format, using a Base64 encoded binary key
 */
openSecureStorage('myStore', AES_256, secureKey, function(store) {
	
	var counter = store.getItem('counter');

	if (counter)
		counter++;
	else
		counter = 1;

	store.setItem('counter', counter);
});
/**
 *	Simplified format, using a plain text password and AES_256 cypher
 */
openSecureStorage('myStore', 'MyP4ssw0rd', function(store) {
	
	var counter = store.getItem('counter');

	if (counter)
		counter++;
	else
		counter = 1;

	store.setItem('counter', counter);
});
/**
 * Removing the store
 */
removeSecureStorage('myStore');

Installation

bower install secure-storage-js --save