Reputation: 909
I have encrypted my text files using AES encryption in Python using Crypto. When I open the encrypted file in notepad, I see a bunch of Chinese characters and a few weird symbols.
Why does the encryption keep producing Chinese characters?
Upvotes: 0
Views: 2217
Reputation: 94038
It probably is interpreting the data as UTF-8. UTF-8 can contain any character or code point defined by the Unicode consortium. That you are getting manny "Chinese" characters is because you are pretty likely to create an UTF-8 escape for using multiple bytes per character, and because there are many more Asian characters than Western characters.
If you want to see "text" then you should encode using base 64. However, files are perfectly fine as binary containing any value of byte. So for the computer / for decryption you're better off leaving the file binary. Ciphertext is meant to be unreadable; there is absolutely no reason to try and "read" it anyway.
Upvotes: 1