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

invalid literal for long() with base 10: '\r\n' #6

Open
adfnekc opened this issue Sep 22, 2020 · 1 comment
Open

invalid literal for long() with base 10: '\r\n' #6

adfnekc opened this issue Sep 22, 2020 · 1 comment

Comments

@adfnekc
Copy link

adfnekc commented Sep 22, 2020

python solve.py --verbose --private -N 460657813884289609896372056585544172485318117026246263899744329237492701820627219556007788200590119136173895989001382151536006853823326382892363143604314518686388786002989248800814861248595075326277099645338694977097459168530898776007293695728101976069423971696524237755227187061418202849911479124793990722597 -e 1
DEBUG: factor N: try past ctf primes
Traceback (most recent call last):
File "solve.py", line 149, in
attackobj.attack()
File "$mypath$/CTF-RSA-tool/lib/RSAutils.py", line 128, in attack
factors = factor_N.solve(self.n, self.e, self.c, self.sageworks)
File "$mypath$/CTF-RSA-tool/lib/factor_N.py", line 19, in solve
return pastctfprimes(N) or noveltyprimes(N) or wiener_attack(N, e) or factordb(N) or comfact_cn(N, c) or smallq(N) or p_q_2_close(N) or None
File "$mypath$/CTF-RSA-tool/lib/factor_N.py", line 96, in pastctfprimes
) if not x.startswith('#') and not x.startswith('\n')]
ValueError: invalid literal for long() with base 10: '\r\n'

@zhangyouyi125
Copy link

add codeand not x.startswith('\r\n')into CTF-RSA-tool/lib/factor_N.py", line 96 can solve it

primes = [long(x) for x in open(os.path.dirname(__file__)+ '/pastctfprimes.txt', 'r').readlines(
    ) if not x.startswith('#') and not x.startswith('\n')and not x.startswith('\r\n')] 

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

2 participants