<commit_before>secure-storage-js [![Build Status](https://travis-ci.org/bealearts/secure-storage-js.png?branch=master)](https://travis-ci.org/bealearts/secure-storage-js) [![Dependency Status](https://david-dm.org/bealearts/secure-storage-js.png)](https://david-dm.org/bealearts/secure-storage-js)
=================
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](http://crypto.stanford.edu/sjcl/) 

Example Usage
-------------
```js
/**
 *	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);
});
```
```js
/**
 *	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);
});
```
```js
/**
 * Removing the store
 */
removeSecureStorage('myStore');
```

Installation
------------

```shell
bower install secure-storage-js --save
```    

<commit_msg>add testing badge<commit_after>secure-storage-js [![Build Status](https://travis-ci.org/bealearts/secure-storage-js.png?branch=master)](https://travis-ci.org/bealearts/secure-storage-js) [![Dependency Status](https://david-dm.org/bealearts/secure-storage-js.png)](https://david-dm.org/bealearts/secure-storage-js)
=================
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](http://crypto.stanford.edu/sjcl/) 

[![browser support](https://ci.testling.com/bealearts/secure-storage-js.png)](https://ci.testling.com/bealearts/secure-storage-js)

Example Usage
-------------
```js
/**
 *	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);
});
```
```js
/**
 *	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);
});
```
```js
/**
 * Removing the store
 */
removeSecureStorage('myStore');
```

Installation
------------

```shell
bower install secure-storage-js --save
```    


{'fraction_non_alphanumeric': 0.18598195697432338, 'fraction_numerical': 0.013879250520471894, 'mean_word_length': 4.348794063079778, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 10, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4164963', 'n_tokens_mistral': 1006, 'n_tokens_neox': 920, 'n_words': 194}