feat: add urlsafe enc to lnbits-cli (#3173)

This commit is contained in:
dni ⚡
2025-05-27 11:51:26 +03:00
committed by GitHub
parent 56aebb9d8f
commit 3c4d186dba
2 changed files with 17 additions and 6 deletions
+7 -2
View File
@@ -93,9 +93,14 @@ class AESCipher:
try:
decrypted_bytes = aes.decrypt(encrypted_bytes)
return self.unpad(decrypted_bytes).decode()
except Exception as exc:
raise ValueError("Decryption error") from exc
raise ValueError("Decryption error: could not decrypt") from exc
unpadded = self.unpad(decrypted_bytes)
if len(unpadded) == 0:
raise ValueError("Decryption error: unpadding failed")
return unpadded.decode()
def encrypt(self, message: bytes, urlsafe: bool = False) -> str:
"""