don't reuse encryption keys, change order of sync status

This commit is contained in:
Mo Bitar
2017-02-10 13:22:39 -06:00
parent 88372e3f02
commit 26808cc57d
2 changed files with 9 additions and 15 deletions

View File

@@ -1,14 +1,8 @@
class EncryptionHelper {
static encryptItem(item, key) {
var item_key = null;
// if(item.enc_item_key) {
// // we reuse the key, but this is optional
// item_key = Neeto.crypto.decryptText(item.enc_item_key, key);
// } else {
item_key = Neeto.crypto.generateRandomEncryptionKey();
item.enc_item_key = Neeto.crypto.encryptText(item_key, key);
// }
var item_key = Neeto.crypto.generateRandomEncryptionKey();
item.enc_item_key = Neeto.crypto.encryptText(item_key, key);
var ek = Neeto.crypto.firstHalfOfKey(item_key);
var ak = Neeto.crypto.secondHalfOfKey(item_key);