Error on base64.b64decode() ?!

C

Christoph Krammer

Hello everybody,

I am using a python script to extract images from email messages. This
works fine for some messages, but not all attached images can be
decoded. I use the following code to decode the image and save it to a
database:

try:
imagedec = base64.b64decode(imageenc)
imagehash = md5.new(imagedec).hexdigest()
dbcurs.execute(<save image>)
except TypeError, e:
print "Error '%s' in Message %s" % (e, dbrow[1])
print imageenc)

The problem is that for some images, the method b64decode() returns a
TypeError "Incorrect Padding". But if I paste the content of imageenc
to some other base64 decode (like this one:
http://www.php-einfach.de/base64_generator.php?code=1), I get the
correct result.

One example content is included below.

Is this a bug in the base64 module, or is there something wrong with
my code?

Regards,
Christoph

---
R0lGODlhOwKDAfcAAAAAAIAAAACAAICAAAAAgIAAgACAgICAgMDAwP8AAAD/AP//AAAA//
8A/wD/
/////
wAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMwAAZgAAmQAAzAAA/
wAzAAAzMwAzZgAzmQAzzAAz/wBm
AABmMwBmZgBmmQBmzABm/wCZAACZMwCZZgCZmQCZzACZ/wDMAADMMwDMZgDMmQDMzADM/
wD/AAD/
MwD/ZgD/mQD/zAD//zMAADMAMzMAZjMAmTMAzDMA/zMzADMzMzMzZjMzmTMzzDMz/
zNmADNmMzNm
ZjNmmTNmzDNm/zOZADOZMzOZZjOZmTOZzDOZ/zPMADPMMzPMZjPMmTPMzDPM/zP/ADP/
MzP/ZjP/
mTP/zDP//2YAAGYAM2YAZmYAmWYAzGYA/2YzAGYzM2YzZmYzmWYzzGYz/
2ZmAGZmM2ZmZmZmmWZm
zGZm/2aZAGaZM2aZZmaZmWaZzGaZ/2bMAGbMM2bMZmbMmWbMzGbM/2b/AGb/M2b/Zmb/
mWb/zGb/
/5kAAJkAM5kAZpkAmZkAzJkA/5kzAJkzM5kzZpkzmZkzzJkz/
5lmAJlmM5lmZplmmZlmzJlm/5mZ
AJmZ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hpAigY3D1upvIs31eVTWLY21dVye4gT8qt
YOwsBumUTcxh1fw5yuU9Tvdcx
+jIjgLFDvzxp8lgR3wKS999GUvlGeUxEVQSC8EJZ2KokZxRkyac
kK9VYEuJXoZsW3WY2ephVTwCGgXhIvrE5xylpAvEG7hFSaYlXvIs3OmlmxbVYLop497oIsHZI6Ct
HbN9KFodBh3B3UupkdcVBlA17Q7HVVOj0KAaEUNgKUauBZbYiA0KIkZABQQAOw=
 
C

Christoph Krammer

If you get an incorrect padding error, try appending a "=" and decoding
again. If you get the error again, try appending one more "=". If it
still doesn't work, then you might be out of luck.

This seems to work in some cases, but not all. Whats the deal with
this adding of "="? Is there an implementation error in python, or are
other implemenations of base64 more robust then they have to be?

Christoph
 
T

Tim Roberts

Christoph Krammer said:
This seems to work in some cases, but not all. Whats the deal with
this adding of "="? Is there an implementation error in python, or are
other implemenations of base64 more robust then they have to be?

The base64 algorithm converts 3 incoming bytes to 4 encoded bytes. When
you decode base64, the input string MUST be a multiple of 4 bytes. Equal
signs are used to pad the strings to 4n bytes.

The web site you used might be doing that alignment for you.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top