Python OTP encryption program help
Go to solution
Solved by colonel_mortis,
When you encrypt the contents, you might end up with bytes that no longer correspond to valid unicode characters, so the str function can't deal with it. Instead of using the str function on line 45, try the bytes function. You will also need to open the file as binary, which means everywhere where you have open(filename, 'r') or open(filename, 'w'), you need to replace it with open(filename, 'rb') or open(filename, 'wb'). I've not tested that this fixes your problems, but I think that should help.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now