Answer the question
In order to leave comments, you need to log in
Why is there an error when decoding base64 from c++ to python?
There is a program written in QT (c++). The program reads the file, encodes it to base64 and sends this string to the server. The server decrypts and writes back to the file. For some reason, part of the file is distorted (it's an image). If the image is sent to the server through a client script in python, then there is no distortion.
The comrade said that most likely there are distortions in the implementation of the base64 encoding algorithm (different RFCs, old in qt). Who can say anything about this? How can you get around? Maybe some modern implementation is?
PS Yes, I know that it is possible to send a file without encoding it. But there are some features here, because of which you still have to encode.
Answer the question
In order to leave comments, you need to log in
Well, somehow fortune-telling comes out. If in one case there are no distortions during loading, then most likely - there is an incorrect loading in the first case.
Tried to decode using any online decoders? For example, base64.ru/
Well, look what the program sends.
Have a look at this just in case en.wikipedia.org/wiki/Base64#Variants_summary_table
Very strange. If there were “different base64s”, that is, jambs at the transmission level, then the resulting file would be so messed up that it simply would not open. If “there are distortions”, then I am also for the fact that the source server is already trying to send a distorted picture.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question