Base64 encoding in Python 3,encoded = 'data to be encoded'.encode('ascii')