crypt.user
Documentation of Synapse Z crypt.user library
crypt.user.encrypt
string crypt.user.encrypt(data: string, type: number, additional_data: string?)
uses libsodium secretbox or aead if additonal_data is provided, nonce is appended to the start
type can be any of following:
TypeName | TypeValue | Description |
---|---|---|
SynapseAccount | 0 | the data could be decrypted if the user have the same synapse account |
WindowsAccount | 1 | the data could be decrypted if the user have the same synapse account and the same windows account |
SynapseIdentifier | 2 | the data could be decrypted if the user have the same synapse acciunt and same HWID |
crypt.user.decrypt
string crypt.user.decrypt(data: string, type: number, additional_data: string?)
uses libsodium secretbox or aead if additonal_data is provided, see crypt.user.encrypt