Skip to content

feat(auth): Add Argon2 Hashing Algorithm support - #637

Merged
ssbushi merged 10 commits into
masterfrom
argon2-impl
Apr 25, 2022
Merged

feat(auth): Add Argon2 Hashing Algorithm support#637
ssbushi merged 10 commits into
masterfrom
argon2-impl

Conversation

@ssbushi

@ssbushi ssbushi commented Feb 7, 2022

Copy link
Copy Markdown
Contributor

Hey there! So you want to contribute to a Firebase SDK?
Before you file this pull request, please read these guidelines:

Discussion

Testing

  • Added unit tests.
  • Added checks for invalid inputs

API Changes

  • Adds new API for Argon2 Hashing support

RELEASE NOTE: Added Argon2 hashing algorithm support in the importUsers() API.

Comment thread src/main/java/com/google/firebase/auth/hash/Argon2.java Outdated
@prameshj

prameshj commented Feb 7, 2022

Copy link
Copy Markdown

Looks good to me.

@lahirumaramba lahirumaramba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you, Sam! Looks pretty good! Left a question on abstraction.

Comment thread src/main/java/com/google/firebase/auth/hash/Argon2.java Outdated
}
}

public enum Argon2HashType {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this could use another layer of abstraction. Similar to what we have done with Hmac and RepeatableHash. We could introduce an abstract class for ARGON2Hash and implementations for ARGON2d, ARGON2i, and ARGON2id. WDYT?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's unnecessary here. For HMAC, it makes sense to add a layer of abstraction since the algorithms are identified as different from one another (HMAC_SHA256 HMAC_SHA1 HMAC_MD5, etc). Here ARGON2 is the algorithm, the hash-types are an additional configuration for the same algorithm.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see. That makes sense. Thanks, Sam!

Comment thread src/test/java/com/google/firebase/auth/hash/InvalidHashTest.java Outdated
Comment on lines +150 to +151
VERSION_10,
VERSION_13

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why these 2 specific versions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lahirumaramba lahirumaramba left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!
Please get a TW to take a quick look at the docs before we merge this. Thanks!

Comment thread src/main/java/com/google/firebase/auth/hash/Argon2.java
@ssbushi
ssbushi merged commit 33b9033 into master Apr 25, 2022
@ssbushi
ssbushi deleted the argon2-impl branch April 25, 2022 13:51
@lahirumaramba lahirumaramba changed the title Add Argon2 Hashing Algorithm support feat(auth): Add Argon2 Hashing Algorithm support Apr 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants