Skip to content

Commit

Permalink
docs: mi/466/hash-verification
Browse files Browse the repository at this point in the history
  • Loading branch information
hajjimo committed Dec 10, 2024
1 parent 8377884 commit 221c328
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/src/content/docs/introduction/hash-verification.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ https://server.example.com/tx

</CodeBlock>

The ASCII encoding of this string is hashed with the `sha-256` algorithm, which is the only hashing algorithm currently supported by Open Payments. The byte array from the hash function is then encoded using Base64 with no padding. The resultant string is the hash value.
The ASCII encoding of this string is hashed with the `sha-256` algorithm, which is the only hashing algorithm currently supported by Open Payments. The byte array from the hash function is then encoded using Base64 with no padding. The resultant string is the hash value.

Using our hash base string example above, the following is the `sha-256` encoded hash that uses the 256-bit SHA2 algorithm.

Expand All @@ -42,7 +42,7 @@ x-gguKWTj8rQf7d7i3w3UhzvuJ5bpOlKyAlVpLxBffY

## Verifying hash

When the client receives a redirect from the AS, the AS will include the hash parameter in the response. The client must calculate this exact value by concatenating the fields referenced above and then applying the `sha-256` hashing algorithm. If the hash value matches the parameter sent by the AS, then the client can be certain the redirect emanated from the AS.
When the client receives a redirect from the AS, the AS will include the hash parameter in the response. The client must calculate this exact value by concatenating the fields referenced above and then applying the `sha-256` hashing algorithm. If the hash value matches the parameter sent by the AS, then the client can be certain the redirect emanated from the AS.

## Further reading

Expand Down

0 comments on commit 221c328

Please sign in to comment.