mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-02-21 05:38:47 -06:00
moved all sources to src directory
This commit is contained in:
14
src/test/cbc_encryption.js
Normal file
14
src/test/cbc_encryption.js
Normal 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.encrypt(dataKey, iv, plainText);
|
||||
const decodedPlainText = data_encryption.decrypt(dataKey, iv, cipherText);
|
||||
|
||||
t.equal(decodedPlainText, plainText);
|
||||
t.end();
|
||||
});
|
||||
Reference in New Issue
Block a user