From afd2d58c61f0c695c3e828019c40eb2d50829968 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Sat, 15 Feb 2025 19:00:40 +0300 Subject: [PATCH] check passphrase length in v1 paste type with base64 (#42) Signed-off-by: R4SAS --- pbincli/format.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/pbincli/format.py b/pbincli/format.py index 89c1988..26394b1 100644 --- a/pbincli/format.py +++ b/pbincli/format.py @@ -120,6 +120,8 @@ class Paste: from base58 import b58decode self._key = b58decode(passphrase) else: + if (len(passphrase) % 4 != 0): + PBinCLIError("Incorrect passphrase! Maybe you have stripped trailing \"=\"?") self._key = b64decode(passphrase)