Skip to content

binascii.Error: Incorrect padding #10

@YuriyGavrilov

Description

@YuriyGavrilov

There is strange behavior of any API reques. It is work properly in the browser but get an error with cli or python.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/yu.gavrilov@group.s7/.local/lib/python3.11/site-packages/privatebinapi/download.py", line 80, in get
    return decrypt_paste(verify_response(response), extract_passphrase(url), password=password)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/yu.gavrilov@group.s7/.local/lib/python3.11/site-packages/privatebinapi/download.py", line 29, in decrypt_paste
    paste.setHash(passphrase)
  File "/home/yu.gavrilov@group.s7/.local/lib/python3.11/site-packages/pbincli/format.py", line 119, in setHash
    self._key = b64decode(passphrase)
                ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/base64.py", line 88, in b64decode
    return binascii.a2b_base64(s, strict_mode=validate)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
binascii.Error: Incorrect padding

May be this could help: https://gist.github.com/perrygeo/ee7c65bb1541ff6ac770

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions