LoginRadius / LoginRadius/csharp-password-hash

expectedHashBase64 in TestHashDataGenerator is wrong

Open
#30 1 comment 0 reactions 1 assignee View on GitHub

@Fyers is already working on this.

Since Oct 6, 2020.

Dominant language
C#
Stars
9
Forks
13
PR merge metrics
No merged PRs in 30d

Description

The values in `TestHashDataGenerator` are kind of wrong in my perspective.
I would assume, that the HashConfig set to Base64 would return the `expectedHashBase64` from the test, but the `expectedHashBase64` really is the Default Encoding (Hex) encoded to UTF8 as a Hex-string (value represented by the Hex is lost at this point) and then encoded to Base64.

I would Change the options of the TestFunction so that it uses the Base64 Encoding all the way.
I am happy to take this.

## Example: SHA256
Expected Hash from `TestHashDataGenerator`: `OGU1MDgzMDlkODUxOTQ4MjZkZDkyY2JhODA5YTc5MzI5OTkwNWRlMTY0YmU0ZjVhN2FhNTIzMmM1ZmZkOTg0NQ==`

HashConfig Base64: `jlCDCdhRlIJt2Sy6gJp5MpmQXeFkvk9aeqUjLF/9mEU=`
HashConfig Hex: `8e508309d85194826dd92cba809a793299905de164be4f5a7aa5232c5ffd9845`
Hash Hex from above -> UTF8 -> Base64 -> `OGU1MDgzMDlkODUxOTQ4MjZkZDkyY2JhODA5YTc5MzI5OTkwNWRlMTY0YmU0ZjVhN2FhNTIzMmM1ZmZkOTg0NQ==`

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.