ItsDangerous use

1. Install

pip install itsdangerous

 

2. Call module, pass parameters instantiate an object, the object used for encryption and decryption.

 

 
 
# Import module, as recommended aliases
from
itsdangerous Import TimedJSONWebSignatureSerializer as the SSS
# Set specific secret key information, and timely information, create an instance S
= the SSS ( 'IT sakey ' , 7200 ) # encrypted information, encrypted code formed Mystery = s.dumps (info) ... # gain access to encrypted information, using the same instance object decryption result = s.loads (mystery)

 

Guess you like

Origin www.cnblogs.com/jrri/p/11517696.html
use
use