Encrypt message data at rest

This commit is contained in:
Dragory 2020-09-16 22:32:43 +03:00
parent 3f3d6af4ed
commit baa3a5640e
No known key found for this signature in database
GPG key ID: 5F387BA66DF8AAC1
10 changed files with 121 additions and 3 deletions

View file

@ -0,0 +1,10 @@
import test from "ava";
import { encrypt, decrypt } from "./crypt";
test("encrypt() followed by decrypt()", t => {
const original = "banana 123 👀 💕"; // Includes emojis to verify utf8 stuff works
const encrypted = encrypt(original);
const decrypted = decrypt(encrypted);
t.is(decrypted, original);
});