From d42717040865338023d5adbed182c08fc476d7ef Mon Sep 17 00:00:00 2001 From: Th3G33k <4394090+Th3G33k@users.noreply.github.com> Date: Mon, 8 Sep 2025 08:49:20 -1000 Subject: [PATCH 1/3] Update zgapdfcryptor.js - fix character encoding --- lib/zgapdfcryptor.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/zgapdfcryptor.js b/lib/zgapdfcryptor.js index 8ddf9b5..be7e4d8 100644 --- a/lib/zgapdfcryptor.js +++ b/lib/zgapdfcryptor.js @@ -60,7 +60,8 @@ z.Crypto = { }, /** @type {string} */ - EncPadding: "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A", + // EncPadding: "\x28\xBF\x4E\x5E\x4E\x75\x8A\x41\x64\x00\x4E\x56\xFF\xFA\x01\x08\x2E\x2E\x00\xB6\xD0\x68\x3E\x80\x2F\x0C\xA9\xFE\x64\x53\x69\x7A", + EncPadding: atob('KL9OXk51ikFkAE5W//oBCC4uALbQaD6ALwyp/mRTaXo='), /** * Add "\" before "\", "(" and ")", and chr(13) => '\r' From 4bdbeabaa2e0084f554515388abd16743bfda61b Mon Sep 17 00:00:00 2001 From: Th3G33k <4394090+Th3G33k@users.noreply.github.com> Date: Mon, 8 Sep 2025 08:57:06 -1000 Subject: [PATCH 2/3] Update zgapdfsigner.js - fix signAndProtect --- lib/zgapdfsigner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zgapdfsigner.js b/lib/zgapdfsigner.js index 7a14dbc..a0425e0 100644 --- a/lib/zgapdfsigner.js +++ b/lib/zgapdfsigner.js @@ -430,7 +430,7 @@ z.PdfSigner = class{ } /** @type {Zga.PdfCryptor} */ _this.cyptr = new z.PdfCryptor(cypopt); - await _this.cyptr.encryptPdf(pdfdoc, encref); + pdfdoc = await _this.cyptr.encryptPdf(pdfdoc, encref); z.log("Pdf data has been encrypted."); } } From bb8faab7d7f2d3729a9bd43b9aa5193f23a6c87a Mon Sep 17 00:00:00 2001 From: Th3G33k <4394090+Th3G33k@users.noreply.github.com> Date: Tue, 23 Sep 2025 15:12:28 -1000 Subject: [PATCH 3/3] Update zgapdfsigner.js - revert commit --- lib/zgapdfsigner.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/zgapdfsigner.js b/lib/zgapdfsigner.js index a0425e0..7a14dbc 100644 --- a/lib/zgapdfsigner.js +++ b/lib/zgapdfsigner.js @@ -430,7 +430,7 @@ z.PdfSigner = class{ } /** @type {Zga.PdfCryptor} */ _this.cyptr = new z.PdfCryptor(cypopt); - pdfdoc = await _this.cyptr.encryptPdf(pdfdoc, encref); + await _this.cyptr.encryptPdf(pdfdoc, encref); z.log("Pdf data has been encrypted."); } }