/x-ss-stub

TikTok x-ss-stub algorithm analysis | encryption algorithm

Primary LanguagePython

If u debug TikTok api requests, sometimes you encounter the x-ss-stub param on post requests and wonder what it is, well here is an in-depth analysis, enjoy.

image

Encryption algorithm:

  • Couldn't be simpler, its an md5 hash, in uppercase

image

Encrypted data:

  • The encrypted data is the urlencoded post data/body

image

use case:

  • x-ss-stub may be required as encryption key/param for some algorithms such as x-gorgon

python script to generate x-ss-stub:

import hashlib

data = "password=4z6d6f6c75604535313434&account_sdk_source=app&username=7d7xx0ze6exx&mix_mode=1&multi_login=1"

print(str(hashlib.md5(data.encode()).hexdigest()).upper())