Skip to content

Commit

Permalink
fix BIDI decrypted text
Browse files Browse the repository at this point in the history
  • Loading branch information
mostafa-kheibary committed Jan 19, 2024
1 parent 5046d4e commit ae6316c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/class/Cipher.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export class Cipher {
}

public async decryptAES(encryptedMessage: string, secretKey: string): Promise<string> {
const decoder = new TextDecoder("utf-8");
const decoder = new TextDecoder();
const encryptedData = new Uint8Array(encryptedMessage.match(/[\da-f]{2}/gi)!.map((hex) => parseInt(hex, 16)));

const iv = encryptedData.slice(0, 16);
Expand Down
1 change: 1 addition & 0 deletions src/content/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ let state: State = { value: "", encrypted: "", submit: false };
const packet = await cipher.resolveDRSAP(messageText);
if (!packet) target.textContent = `⛔Error in decryption⛔`;
else target.textContent = packet;
target.dir = "auto";
} catch (error) {
target.textContent = `⛔Error in decryption⛔`;
}
Expand Down

0 comments on commit ae6316c

Please sign in to comment.