I am trting to decode the below given reversed multi line string encoded in base64 format.
LnNlbHBtYXhlIGVzdSBvdCBlZXJmIGxlZUYgLnNldGlzYmV3IGNpZmZhcnQgaGdpaCBubyBub2l0YXNpbGFtcm9uZWQgZm8gdHBlY25vYyBlaHQgZWJpcmNzZUQgLjQ=
ZWxpZiBlbm8gbmkgZWIgdHN1TSApaXYgICAg
s = 'ZWxpZiBlbm8gbmkgZWIgdHN1TSApaXYgICAg'
s = s.decode('base64', 'strict')
print s[::-1]
by the above method I get correct strings but I have to change the string manually.
Please help.
From the OP’s comment:
the
joinoperation connects all of the strings together, but only the first string is translated. This is because, when decoding a base 64 string, everything in the string past the first one or two=characters is ignored. Instead of joining, iterate:Or use a list comprehension.
Output: