Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #485: Crypto 3.2: Prevent replay attacks #486

Merged
merged 31 commits into from
Jul 29, 2023

Conversation

romanstrobl
Copy link
Member

No description provided.

Copy link
Member

@banterCZ banterCZ left a comment

Choose a reason for hiding this comment

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

Looks good, just minor comments to consider.

Copy link
Member

@hvge hvge left a comment

Choose a reason for hiding this comment

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

I found some minor issues and one flaw in my specification that has to be addressed.

@romanstrobl romanstrobl requested review from hvge and banterCZ June 2, 2023 12:49
Copy link
Member

@petrdvorak petrdvorak left a comment

Choose a reason for hiding this comment

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

While the intentions of the change are well reasoned and prevent the issue on a system level, I would not write the code 1:1 according to the specification because the resulting protocol seems to diverge from formal ECIES description too much. Instead, I would adjust the code so that:

  • core ECIES is unchanged
  • additional values (additional data, timestamp, ...) are mapped to SharedInfo1 and SharedInfo2
  • EciesCryptogram object is split to "body" (encrypted payload, ephemeral public key, mac) and "headers" (timestamp, nonce, context values such as additional data, etc.)

Copy link
Member

@hvge hvge left a comment

Choose a reason for hiding this comment

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

Looks OK

@romanstrobl
Copy link
Member Author

The updated ECIES implementation is ready for review.

@romanstrobl romanstrobl requested a review from hvge July 20, 2023 04:30
Copy link
Member

@banterCZ banterCZ left a comment

Choose a reason for hiding this comment

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

Looks good.

Copy link
Member

@hvge hvge left a comment

Choose a reason for hiding this comment

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

Look OK (change about moving deriveAssociatedData() to this library)

@romanstrobl
Copy link
Member Author

Alright, I will merge this pull request and I will publish the updated powerauth-crypto library after merge

@romanstrobl romanstrobl dismissed petrdvorak’s stale review July 29, 2023 22:12

Already implemented

@romanstrobl romanstrobl merged commit 0eba4f8 into develop Jul 29, 2023
4 checks passed
@romanstrobl romanstrobl deleted the issues/485-prevent-replay-attacks branch July 29, 2023 22:12
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.

4 participants