Answered step by step
Verified Expert Solution
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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started