Here is some code I saw recently:
import base64
code="CmltcG9ydCBweW1vbmdvCmltcQ" #very long
eval(compile(base64.b64decode(code), "<string>", 'exec'))
I know what it does, it’s very to decode it. But I got curious about how to do it by myself. So if I have an application and I want to encode it and make it run it by the code, what should I do to encode it to get base64 string of it?
You encode valid python source code contained in a string: