Sha256 keyword modifier


(Gavin Boyd) #1

Matrix Version: 5.4.0.2

Does Matrix have SHA256 capabilities? I can see SHA1 keyword only.


(Bart Banda) #2

What specific functionality around SHA256 are you after?


(Gavin Boyd) #3

The API which we are using requires you to use sha256 as part of signing requests. The steps for signing a request are:

  1. Increment the token nonce so it is a higher number than the previous request. The increments do not need to be sequential.
  2. Collect all the parameters you need to send for your request into a key/value array, include the token key and nonce.
  3. Extract only the values from the parameters array and add the token secret.
  4. Order these values alphabetically, they must be compared as strings rather than numbers.
  5. Concatenate the values, joining by the ‘-’ character.
  6. Generate the signature by hashing this string using the sha256 algorithm.
  7. Add the secret to the parameters array.
  8. Submit the request using either GET or POST.

(Bart Banda) #4

Thanks for explaining. So would a ^SHA256 keyword modifier similar to the SHA1 be useful?