Convert to binary and convert back to strings
Steven D'Aprano
steve at REMOVE.THIS.cybersource.com.au
Thu Feb 22 04:56:30 EST 2007
On Wed, 21 Feb 2007 16:46:19 -0800, Harlin Seritt wrote:
>> WARNING: THIS IS NOT A STRONG ENCRYPTION ALGORITHM. It is just a
>> nuisance for someone that really wants to decrypt the string. But
>> it might work for your application.
>>
>> -Larry
>
> Thanks Larry! I was looking for something more beautiful but what the
> hey, it works!
Is this beautiful enough?
>>> s = "Python"
>>> u = unicode(s, "ascii")
>>> u
u'Python'
>>> u.encode('rot13')
'Clguba'
For extra security, you can encode the string with rot13 twice.
--
Steven.
More information about the Python-list
mailing list