factordb | RSA primes numbers | Cryptography library
kandi X-RAY | factordb Summary
kandi X-RAY | factordb Summary
RSA primes numbers /RSA/CTFs
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- Parse arguments
- Interactively interact with a query
- The main function
- Print a banner
- Get a prime value
- Display usage of python factordb py
factordb Key Features
factordb Examples and Code Snippets
Community Discussions
Trending Discussions on factordb
QUESTION
I participated in DawgCTF 2 days ago. And I was about to solve RSA problem but I couldn't solve.
DawgCTF's RSA problem was given n, e, c.
so, I factorized n using factordb, and the result of n was the square of only one prime.(That is, n=p^2)
I've never seen a case where p and q are the same in RSA Crypto.
Anyway, I let phi be (p-1)(q-1) and wrote the code as below. (phi means Euler's phi)
ANSWER
Answered 2021-May-10 at 17:21The first equal sign in phi(p * q) = phi(p) * phi(q) = (p - 1) * (q - 1)
assumes that p
and q
are coprime (see [1]), while the second equal sign assumes that p
and q
are prime (see [2], k = 1
). p = q
violates the first condition, which is why this relation is not valid for p = q
.
On the other hand, for k = 2
, it follows from [2] phi(p * p) = p * (p - 1)
, i.e. the relation used in the CTF solution for p = q
.
For RSA in practice, however, p != q
is a prerequisite, see [3] and [4] (otherwise p
and q
could be determined quickly: p = q = sqrt(N)
).
QUESTION
Giving N, e, c as follows:
...ANSWER
Answered 2020-Apr-06 at 05:04Thanks for your help! I kown the difficulty to factor a big integer, but this big number appeared in a CTF question.So I think there must be some method to crack it in the limited time. And finally I found the method.The N c e mentioned above is just a half information, and another half of info I got by sql-injection and they are N c1 e1. So the final method to crack it is Common Modulus Attack.So I can get flag by given N e1 e2 c1 c2 without the d1,d2(N=d1*d2)...Thank you guys anyway!
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install factordb
You can use factordb like any standard Python library. You will need to make sure that you have a development environment consisting of a Python distribution including header files, a compiler, pip, and git installed. Make sure that your pip, setuptools, and wheel are up to date. When using pip it is generally recommended to install packages in a virtual environment to avoid changes to the system.
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page