Comment 1 for bug 1177614

Revision history for this message
Legrandin (gooksankoo) wrote :

The line:

message = 'To be encrypted'

should be:

message = b'To be encrypted'

In Python 3, strings are not encoded and therefore cannot be encrypted (unless one silently performs some arbitrary encoding like Latin 1). In Python 2, strings and encoded strings (that is, a "bytes" object) were mixed and your example would have worked.

See here:

http://eli.thegreenplace.net/2012/01/30/the-bytesstr-dichotomy-in-python-3/