changing from AES-256-CTR to AES-128-CBC for note encryption

This commit is contained in:
azivner
2017-11-15 22:13:45 -05:00
parent 2533b8e121
commit 5313ac47e6
10 changed files with 184 additions and 31 deletions

14
test/cbc_encryption.js Normal file
View File

@@ -0,0 +1,14 @@
const test = require('tape');
const data_encryption = require('../services/data_encryption');
test('encrypt & decrypt', t => {
const dataKey = [1,2,3];
const iv = [4,5,6];
const plainText = "Hello World!";
const cipherText = data_encryption.encryptCbc(dataKey, iv, plainText);
const decodedPlainText = data_encryption.decryptCbc(dataKey, iv, cipherText);
t.equal(decodedPlainText, plainText);
t.end();
});