Tornado Encookie - Encrypted Cookies

97 views
Skip to first unread message

Shane Spencer

unread,
May 7, 2013, 4:50:54 PM5/7/13
to python-...@googlegroups.com
This is something I personally need, and I am hoping it is useful to others.  Contribution needed: Exception handling :)

Aleksey Silk

unread,
May 7, 2013, 10:00:59 PM5/7/13
to python-...@googlegroups.com
very nice. thank you ...

С уважением, Алексей Силк
With best regards, Aleksey Silk
 
skype - rootiks
 


2013/5/8 Shane Spencer <sh...@bogomip.com>
This is something I personally need, and I am hoping it is useful to others.  Contribution needed: Exception handling :)

--
You received this message because you are subscribed to the Google Groups "Tornado Web Server" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python-tornad...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

aliane abdelouahab

unread,
May 8, 2013, 3:23:08 PM5/8/13
to Tornado Web Server
thank you :D

aliane abdelouahab

unread,
May 8, 2013, 5:05:51 PM5/8/13
to Tornado Web Server
sorry for that dumb question, but what is difference with the
tornado's secure_cookie?

On 7 mai, 21:50, Shane Spencer <sh...@bogomip.com> wrote:

Shane Spencer

unread,
May 8, 2013, 5:37:01 PM5/8/13
to python-...@googlegroups.com

Secure cookies are unencrypted but tamper proof. This module simply adds encryption

aliane abdelouahab

unread,
May 8, 2013, 5:55:42 PM5/8/13
to Tornado Web Server
ah! thank you, will use it right now ;)
thank you again

On 8 mai, 22:37, Shane Spencer <sh...@bogomip.com> wrote:
> Secure cookies are unencrypted but tamper proof. This module simply adds
> encryption
> On May 8, 2013 1:05 PM, "aliane abdelouahab" <alabdeloua...@gmail.com>

Алексей Силк

unread,
May 20, 2013, 7:50:33 AM5/20/13
to python-...@googlegroups.com, sh...@bogomip.com
    Traceback (most recent call last):
      File "/var/www/myftpbackup/tornado/web.py", line 1055, in _stack_context_handle_exception
        raise_exc_info((type, value, traceback))
      File "/var/www/myftpbackup/tornado/web.py", line 1178, in wrapper
        result = method(self, *args, **kwargs)
      File "/var/www/myftpbackup/classes/indexall.py", line 39, in get
        ppKwargs = self.indexPageRun()
      File "/var/www/myftpbackup/classes/indexall.py", line 16, in indexPageRun
        ppUser = self.encookie.get_secure_cookie('user'),
      File "/var/www/myftpbackup/tornadoencookie/encookie.py", line 53, in get_secure_cookie
        return self._decrypt(encrypted_value.decode('utf-8'))
      File "/var/www/myftpbackup/tornadoencookie/encookie.py", line 29, in _decrypt
        return self.cipher.decrypt(base64.b64decode(value.encode('utf-8'))).decode('utf-8').rstrip(self.PADDING)
      File "/usr/lib/python2.7/base64.py", line 76, in b64decode
        raise TypeError(msg)
    TypeError: Incorrect padding
[E 130520 11:49:31 web:1514] 500 GET / (94.124.176.133) 188.60ms
[W 130520 11:49:32 web:1514] 404 GET /favicon.ico (94.124.176.133) 3.76ms

On ptyhon 2.7 I'm getting this error ... Any suggestions?


среда, 8 мая 2013 г., 0:50:54 UTC+4 пользователь Shane Spencer написал:

Aleksey Silk

unread,
May 20, 2013, 8:33:19 AM5/20/13
to python-...@googlegroups.com
I didin't delete previous cookie. Now everything works fine.

С уважением, Алексей Силк
With best regards, Aleksey Silk
 
skype - rootiks
 


2013/5/20 Алексей Силк <ale...@silk.bz>
--
Reply all
Reply to author
Forward
0 new messages