Skip to content

Conversation

@nicole-graus
Copy link
Contributor

@nicole-graus nicole-graus commented Apr 7, 2025

Pohlig Hellman Attack Example

Description

This PR adds an implementation that demonstrates the Pohlig-Hellman algorithm for solving the discrete logarithm problem on subgroups of elliptic curves.

In this example we chose to work with a subgroup of the BLS12-381 Elliptic Curve of order
$$s = 96192362849 = 11 \cdot 10177 \cdot 859267.$$

This attack is significantly more efficient than attempting to solve the discrete logarithm problem using brute-force search. Using the Pohlig-Hellman attack, the logarithm can be recovered in under one second, whereas a brute-force approach could take several days.

This highlights the importance of avoiding groups with small primes order factorization in cryptographic applications.

@codecov-commenter
Copy link

codecov-commenter commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 72.05%. Comparing base (ca84326) to head (8750d90).

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #995   +/-   ##
=======================================
  Coverage   72.05%   72.05%           
=======================================
  Files         160      160           
  Lines       35122    35122           
=======================================
  Hits        25306    25306           
  Misses       9816     9816           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nicole-graus nicole-graus marked this pull request as ready for review April 7, 2025 20:59
@nicole-graus nicole-graus requested a review from a team as a code owner April 7, 2025 20:59
Comment on lines 103 to 104
let x = chinese_remainder_theorem(&equations)?;
Ok(x as u128)
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
let x = chinese_remainder_theorem(&equations)?;
Ok(x as u128)
chinese_remainder_theorem(&equations).and_then(|x| x as u128)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks, we changed it here.

@diegokingston diegokingston added this pull request to the merge queue Apr 8, 2025
Merged via the queue into main with commit 83c041d Apr 8, 2025
8 checks passed
@diegokingston diegokingston deleted the ph-attack-example branch April 8, 2025 20:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants