From fcbb4e25eceffbd54175b9b45ae340777cb7380d Mon Sep 17 00:00:00 2001 From: Spencer Miller Date: Sun, 4 Aug 2024 09:20:10 +0300 Subject: [PATCH] fix bug in decryptRSA --- src/crypto_utils.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/crypto_utils.ts b/src/crypto_utils.ts index bbb07ef..ca35e63 100644 --- a/src/crypto_utils.ts +++ b/src/crypto_utils.ts @@ -85,7 +85,11 @@ export function decryptRSA(privateKey: Uint8Array, ciphertext: string): string { const userKey: Array = [] for (let i = 0; i < decryptedBytes.length; i++) { - userKey.push(decryptedBytes[i].toString(16)) + userKey.push( + decryptedBytes[i] + .toString(16) + .padStart(2, '0') // make sure each cell is one byte + ) } return userKey.join("")