Flask Session Verify

Verifies the HMAC signature of a Flask session cookie (itsdangerous) generated.

Input: TextResult: Structured JSON

Text input

Run to see the result

Examples

Example keys and passwords are public test material.

Flask Session: Verify Sha1

Input

eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aZ-KEw.E_x6bOhA4GU9t72pMinJUjN-O3I

Expected answer

JSON
{
    "valid": true,
    "payload": {
        "role": "superuser",
        "user": "admin"
    }
}
Key
{"string":"mysecretkey","option":"UTF8"}
Salt
{"string":"cookie-session","option":"UTF8"}
Algorithm
sha1
View TimeStamp
Off
Flask Session: Verify Sha1 Wrong Key

Input

eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aZ-KEw.E_x6bOhA4GU9t72pMinJUjN-O3I

Expected rejection

Message contains
Invalid signature!
Key
{"string":"notTheKey","option":"UTF8"}
Salt
{"string":"cookie-session","option":"UTF8"}
Algorithm
sha1
View TimeStamp
Off
Flask Session: Verify Sha1 Wrong Salt

Input

eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aZ-KEw.E_x6bOhA4GU9t72pMinJUjN-O3I

Expected rejection

Message contains
Invalid signature!
Key
{"string":"mysecretkey","option":"UTF8"}
Salt
{"string":"notTheSalt","option":"UTF8"}
Algorithm
sha1
View TimeStamp
Off
Flask Session: Verify Sha256

Input

eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aab3Ew.Jsx2DOx_H9anZg0YcvhsASxQ11897EFHeQfS2oja4y8

Expected answer

JSON
{
    "valid": true,
    "payload": {
        "role": "superuser",
        "user": "admin"
    }
}
Key
{"string":"mysecretkey","option":"UTF8"}
Salt
{"string":"cookie-session","option":"UTF8"}
Algorithm
sha256
View TimeStamp
Off
Flask Session: Verify Sha256 Wrong Key

Input

eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aab3Ew.Jsx2DOx_H9anZg0YcvhsASxQ11897EFHeQfS2oja4y8

Expected rejection

Message contains
Invalid signature!
Key
{"string":"notTheKey","option":"UTF8"}
Salt
{"string":"cookie-session","option":"UTF8"}
Algorithm
sha256
View TimeStamp
Off
Flask Session: Verify Sha256 Wrong Salt

Input

eyJyb2xlIjoic3VwZXJ1c2VyIiwidXNlciI6ImFkbWluIn0.aab3Ew.Jsx2DOx_H9anZg0YcvhsASxQ11897EFHeQfS2oja4y8

Expected rejection

Message contains
Invalid signature!
Key
{"string":"mysecretkey","option":"UTF8"}
Salt
{"string":"notTheSalt","option":"UTF8"}
Algorithm
sha256
View TimeStamp
Off

Related tools

Browse encryption / encoding tools