Generating and Decrypting Client ID
Generating and Decrypting Client ID

Client_id is an encrypted set of information that allows next4biz CSM to identify a user.

The plain format of client_id:

“email={0}&name={1}&surname={2}&lang={3}”

If additional information needs to be passed, “payload” parameter can be appended. “payload” parameter is optional.

“referrer” parameter is also optional and likewise can be appended to the parameter list above. If referrer parameter is passed, the referrer value will automatically be added to the description of the issue entered.

“lang” is a two character ISO language code. Example : tr, en, de, ru, ar.

The parameter list must be URLencoded to a single string.

The Algorithm for generating client_id

  • GetEncryptedClientId
    • encrypted = Encrypt(client_id_plain)
    • withNonce = nonce + encrypted (string concat)
    • bytes = Encrypt(withNonce)
    • base64 = Base64(bytes)
    • client_id = UrlEncode(base64)
  • Encrypt Method
    • Rijndael IV: byte[] vector = { 5, 175, 240, 68, 75, 126, 45, 104, 228, 79, 31, 17, 43, 108, 252, 65 };
    • key = SHA256 standard hash(passphrase)
    • encrypted = Rijndael 256 bit encryption of data
    • return encrypted
  • Decrypt Method
    • Rijndael IV: byte[] vector = { 5, 175, 240, 68, 75, 126, 45, 104, 228, 79, 31, 17, 43, 108, 252, 65 };
    • key = SHA256 standard hash(passphrase)
    • decrypted = Rijndael 256 bit decryption of data
    • return decrypted
  • GetDecryptedClientId
    • urlDecoded = UrlDecode(encryptedClientId)
    • encryptedWithNonce = decode_base64(urlDecoded)
    • withNonce = Decrypt(encryptedWithNonce)
    • withoutNonce = withNonce başındaki nonce silinir.
    • client_id_plain = Decrypt(withoutNonce)

Decrypt and GetDecryptedClientId methods are reverse of the encrypt methods. Passphrase is the key that is preshared by next4biz CSM.