Issue #14: Generate eGUIDs from GUIDs - use raw bytes - code cleanup #19
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR fixes several issues associated with the previously merged PR #17 namely:
phiHashFunction
function so that the hashing algorithm can easily be switched to a different one if needed and thephiHashFunction
can be shared between both client and server Javascript programs. ThisphiHashFunction
function removes all non-hash information (eg. salt, version number, etc...) and returns the hash as aUint8Array
of bytes.window.atob()
does not work as bcrypt uses non-standardized base64 encoding andwindow.atob()
cannot handle the.
and/
characters.To test:
Setting
enableObfuscation
inproject-config.json
tofalse
will cause the application to generate GUIDs.Generated GUIDs should be deterministic - the same
<Health card,Province code,Date of birth>
should always generate the same GUID.Changing even just one of the Health card, Province code, or Date of birth values should result in a different GUID.
Setting
enableObfuscation
inproject-config.json
totrue
will cause the application to generate eGUIDs.Generated eGUIDs should be non-deterministic - the same
<Health card,Province code,Date of birth>
should generate different eGUIDs.Test with the
issues-13-14_code-cleanup_test
branch and open the browser's web console. The value associated with theWorking with: ...
message should deterministic with respect to the Health card, Province code, and Date of birth values, while the output displayed in the eGUID table column should be non-deterministic. The value associated with theRound-trip, base64 re-encoded to: ...
message should always be the same as the value associated with the previousWorking with: ...
message.