marcusklaas / yapm-client

super-straight-forward-single-user-json-aes-based-online-password-manager
4 stars 1 forks source link

upgrade storage format #6

Closed marcusklaas closed 9 years ago

marcusklaas commented 9 years ago

The current library file grows large quite quickly. We should

marcusklaas commented 9 years ago

The result is already base64 encoded!

marcusklaas commented 9 years ago

Use this for compression: https://github.com/nmrugg/LZMA-JS. Probably a bit overkill, but the library looks too good to pass up on.

marcusklaas commented 9 years ago

Maybe https://github.com/pieroxy/lz-string/ is a better fit. It's a lot faster than LZMA and the library is smaller.

Besides adding compression, we should change the outermost layer of our library from

{
    hmac: String,
    library: Object
}

to

{
    hmac: String,
    library: String // JSON representation of library object
}

This should save us a JSON.stringify operation during decoding and, more importantly, makes our integrity check independent of JSON printer.