PicoCTF-2022 Writeup
  • README
  • Binary Exploitation
    • buffer overflow 1
    • buffer overflow 2
    • buffer overflow 3
    • flag leak
    • function overwrite
    • ropfu
    • stack cache
    • x-sixty-what
  • Cryptography
    • basic-mod1
    • basic-mod2
    • diffie-hellman
    • morse-code
    • NSA Backdoor
    • Sequences
    • substitution
    • Sum-O-Primes
    • Very Smooth
  • Forensics
    • Operation Oni
    • Operation Orchid
    • SideChannel
    • St3g0
    • Torrent Analyze
  • Reverse Engineering
    • Bbbbloat
    • Keygenme
    • unpackme
    • Wizardlike
  • Web Exploitation
    • Forbidden Paths
    • noted
    • Roboto Sans
    • SQLiLite
Powered by GitBook
On this page
  • Challenge
  • Solution
  • Flag

Was this helpful?

Edit on GitHub
  1. Cryptography

Sum-O-Primes

PrevioussubstitutionNextVery Smooth

Last updated 3 years ago

Was this helpful?

Challenge

We have so much faith in RSA we give you not just the product of the primes, but their sum as well!

Solution

Run the solution , which uses the equations for p and p-q from ().

The two equations can be combined to form: p=(x+sqrt(x^2-4*n))/2.

gmpy2 is used to store large numbers and it's precision is set to 2048 ate the beginning of the script to ensure that no digits are lost.

Flag

picoCTF{3921def5}

gen.py
output.txt
script.py
this paper
Archive