summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpolwex <polwex@sortug.com>2025-07-16 16:56:35 +0700
committerpolwex <polwex@sortug.com>2025-07-16 16:56:35 +0700
commit321965690f17df74c090331f8562ae7e82c5dff9 (patch)
tree90535fd67b8d9b89f8673b91cd180b69c34bbe71
parent43db7d9fdaf9877325aae02cdad9b7bf3adc01e9 (diff)
its called we do a little cleanupmasters-and-tickets
-rw-r--r--lib/passkey.ts6
1 files 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<string> {
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<string> {
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;
}