Some fixes.

The key does not need to be decoded before decrypting - it was used in base64encoded form for encryption.

I stripped a stray newline from the outgoing token.

This version now works with my Django 1.4.5.