CloudServices/Sagrada/TokenServer: Difference between revisions

No edit summary
Line 175: Line 175:
Example:
Example:


   app_token = {'email': 'my@email.com', 'someparam': 1324654308.907832}   
   meta_token = {'email': 'my@email.com', 'someparam': 1324654308.907832}   


To avoid information leakage, the token is encrypted and signed using the shared secret and base64-ed. The encryption is AES-CBC and signature is HMAC-SHA1:
To avoid information leakage, the token is encrypted and signed then base64-ed. The encryption is AES-CBC using the encryption key, the signature is HMAC-SHA1 using the signing key:


   app_token, signature = AES-CBC+HMAC-SHA1(app_token, secret_key)
   meta_token = AES-CBC(meta_token, enc_secret)
   app_token = b64encode(app_token, signature)
  meta_token, signature = HMAC-SHA1(meta_token, sig_secret)
   meta_token = b64encode(meta_token, signature)




'''The metadata token is crypted'''
'''The metadata token is encrypted'''


== Shared Secrets File ==
== Shared Secrets File ==
Confirmed users
358

edits