From 321965690f17df74c090331f8562ae7e82c5dff9 Mon Sep 17 00:00:00 2001 From: polwex Date: Wed, 16 Jul 2025 16:56:35 +0700 Subject: its called we do a little cleanup --- lib/passkey.ts | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/passkey.ts b/lib/passkey.ts index b03ecf5..581da26 100644 --- a/lib/passkey.ts +++ b/lib/passkey.ts @@ -323,12 +323,10 @@ export async function pkEncryptXOR(dataBytes: Uint8Array): Promise { console.log({ key: key.byteLength, data: encrypted.byteLength }); // XOR with derived key (repeat key if data is longer) - const hash = Uint8Array.from(key, (v, i) => v ^ encrypted[i]); for (let i = 0; i < dataBytes.length; i++) { encrypted[i] = dataBytes[i] ^ key[i % key.length]; } - console.log({ hash, encrypted }); // Return nonce + encrypted data as base64 const result = new Uint8Array(nonce.length + encrypted.length); result.set(nonce); @@ -351,9 +349,9 @@ export async function pkDecryptXOR(encryptedData: string): Promise { for (let i = 0; i < encrypted.length; i++) { decrypted[i] = encrypted[i] ^ key[i % key.length]; } - const hash = Uint8Array.from(key, (v, i) => v ^ encrypted[i]); const one = bytes2hex(decrypted); - const two = bytes2hex(hash); + // const hash = Uint8Array.from(key, (v, i) => v ^ encrypted[i]); + // const two = bytes2hex(hash); return one; } -- cgit v1.2.3