by Jason on June 10, 2012

Today I started a new project named PackageStore which I expect to be iterating on over the next few weeks.

The main purpose of this library is to provide an interface exactly like localStorage for setting/getting variables, but behind the scenes storing the data in a single localStorage key. Also, it should provide very simple hooks to encrypt/decrypt this data.

So, why do this?

Modern applications are beginning to move to JavaScript. With the advent of Backbone and various other systems there has been a movement to move the majority of application code to the browser instead of the server. Managing application state now becomes an instant concern for any competent JavaScript developer.

Given that JavaScript applications are inherently manipulatable (read: insecure) you have to think of ways to make JavaScript hackers job difficult. So you do some common things such as compiling JavaScript, minifying JavaScript, using the Module design pattern so “private” variables are not easily manipulated, etc.

Another obfuscation tool is to store all state management variables within a single key, and encrypt the contents.

I welcome your feedback on everything!
Github Source