Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Can I get help resolving this incorrect padding error? Function description: decodexorbase64(string, key) which takes the output of the previous function (xor'd string and base64

Can I get help resolving this incorrect padding error?

Function description:

decodexorbase64(string, key) which takes the output of the previous function (xor'd string and base64 encoded key) and returns the original string, in b' format

My code:

def decodexorbase64(code, keyb64):

keyoriginal = binascii.a2b_base64(key) stroriginal = binascii.a2b_base64(string) return (stroriginal, keyoriginal)

Issue:

print(decodexorbase64(b'\x02\x01\x04\x00\x03\x00Y^\x00', b'a2VybWl0 '))

Gives the error: binascii.Error: Incorrect padding

What can I write in my code to avoid this error?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Intelligent Databases Object Oriented Deductive Hypermedia Technologies

Authors: Kamran Parsaye, Mark Chignell, Setrag Khoshafian, Harry Wong

1st Edition

0471503452, 978-0471503453

More Books

Students also viewed these Databases questions