encrypt-stack
Version:
An encryption driver/stack to create a multi-layer encrypted workflow in Node.
15 lines (13 loc) • 468 B
JavaScript
;
const EncryptionStack = require("./index.js");
for(let i=1; i<=20; i++){
const start = new Date().getTime();
const alice = new EncryptionStack(i);
const bob = new EncryptionStack(i);
alice.computeSecret(bob.keys());
bob.computeSecret(alice.keys());
const e = alice.encrypt("hello world");
const d = bob.decrypt(e);
const finish = new Date().getTime();
console.log("["+i+"]", (finish-start)+"ms", ":", ((finish-start)/2)+"ms");
}