Encrypt message data at rest
This commit is contained in:
parent
3f3d6af4ed
commit
baa3a5640e
10 changed files with 121 additions and 3 deletions
10
backend/src/utils/crypt.test.ts
Normal file
10
backend/src/utils/crypt.test.ts
Normal 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);
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue