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

Investigate correctness of RSA example #60

Open
syreal17 opened this issue Feb 8, 2025 · 0 comments
Open

Investigate correctness of RSA example #60

syreal17 opened this issue Feb 8, 2025 · 0 comments

Comments

@syreal17
Copy link
Collaborator

syreal17 commented Feb 8, 2025

https://discord.com/channels/575006934089072650/759508515403726858/1337172891883671674

Hello! I guess, I found a mistake in the CTF Primer, section 6.5 Modern Cryptography. In the first point of RSA key generation algorithm says "Generate two large co-prime numbers, p and q.". But it's incorrect because we need to generate two large prime numbers, otherwise the Euler's totient function won't be equal (p-1)(q-1) in general, because p or q if they are just co-prime may not be prime. And further in the example we have p = 13 and q = 9. Since q isn't a prime number the Euler's totient function in the example is wrong calculated and algorithm don't work in some cases. For example if we try to encode number 105, we will get 27. If we try to decode it, we will get 27 again (not 105 as expected).

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

No branches or pull requests

1 participant