erikcw napisal(a):
> Hi,
>
> I'm trying to devise a scheme to encrypt/obfuscate a short string that
> basically contains the user's username and record number from the
> database.  I'm using this encrypted string to identify emails from a
> user. (the string will be in the subject line of the email).
>
> I'm trying to figure out which approach I should use to encrypt the
> data.  The string will be less than 20 characters long, and I'd like
> the encrypted version to be about the same size.
>
> I tried DES in the Crypto module, but the cipher text was to long to
> be usable in this case.
>
> Any suggestions?
>
> Thanks!

How about:
>>> hashlib.sha256("[EMAIL PROTECTED]|2937267834").hexdigest()[:20]

Regards,
Marek
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to