How AEAD key derivation works
mainShadowsocks derives a per-session subkey from a pre-shared master key (provided by the user or generated from a password) using HKDF_SHA1.
Key derivation follows the EVP_BytesToKey(3) specification from OpenSSL. The HKDF_SHA1 function requires:
key: The secret key.salt: A non-secret salt that must be unique throughout the life of the pre-shared master key.info: The application context string, which must be exactly"ss-subkey"(without quotes).
HKDF_SHA1(key, salt, info) => subkey