12345678910const KAT_PLAINTEXT = "peach self-test vector v1";11const KAT_PASSWORD = "kat-fixed-password-do-not-use";12const SALT = Buffer.from("1719d355fb0e9b33cc95bca2298a00c9", "hex");13const NONCE = Buffer.from("6b65792d6e6f6e63652d3031", "hex");1415const km = await crypto.subtle.importKey(16 "raw",17 new TextEncoder().encode(KAT_PASSWORD),18 "PBKDF2",19 false,20 ["deriveKey"],21);22const key = await crypto.subtle.deriveKey(23 { name: "PBKDF2", salt: SALT, iterations: 1000, hash: "SHA-256" },24 km,25 { name: "AES-GCM", length: 256 },26 false,27 ["encrypt"],28);29const ct = await crypto.subtle.encrypt(30 { name: "AES-GCM", iv: NONCE },31 key,32 new TextEncoder().encode(KAT_PLAINTEXT),33);3435console.log(Buffer.from(ct).toString("hex"));