add option to randomize keys

This commit is contained in:
marlon-erler
2026-09-30 17:33:53 +02:00
parent 24610af08e
commit c78c5747cf
246 changed files with 20560 additions and 33 deletions
+8 -1
View File
@@ -1,7 +1,14 @@
import cryptoRandomString from "crypto-random-string";
const IV_SIZE = 12;
const ENCRYPTION_ALG = "AES-GCM";
// minimal
// random
export function random(length: number): string {
return cryptoRandomString({length})
}
// encrypt
export async function encryptString(
plaintext: string,
passphrase: string,