devgeeks/Encryptr — pull request #130 by devgeeks (2014-09-23 01:05:51+00:00)
Title: Implemented a local encrypted cache

Note: this is a temporary enhancement until Crypton gets container compaction (https://github.com/SpiderOak/crypton/issues/307) and offline access.

Replaced the plain text temporary sessionStorage with an encrypted persistent localStorage. Directly uses `sjcl.encrypt()` and `sjcl.decrypt()`.

Upon fetching the index container, it encrypts and persists just the current state of the collection (`this.collection.toJSON()`, no container history, etc) to localStorage. Subsequent logins, if the persisted local cache exists for that username, it decrypts it using their passphrase, then loads it into the index container updating the view. It then proceeds to fetch/sync from the server and displays a "Syncing entries.." message instead of the default "Decrypting entries..." until it completes the sync.