[Python] I'm decoding a crypto CTF but I don't know if I did mistake or the PC is weak, I got...

Discussão em 'Python' iniciado por Stack, Julho 5, 2025.

  1. Stack

    Stack Membro Participativo

    We can change the value of i,j and the max , thanks for your help guys Here is the python code :

    from Crypto.Util.number import isPrime
    N = 39857078746406469131129281921490520306196739933449401384580614683236877901453146754149222509812535866333862501431453065249306959004319408436548574942416212329735258587670686655658056553446879680643872518009328886406310298097685861873954727153720761248262606469217940464611561028443119183464419610396387619860313813067179519809796028310723320608528262638653826016645983671026819244220510314301178181698134390850683834304169240632402535087021483298892547974104858755498823118164815682452718215716370727477136888839954993949013970026988378086175471190518276414200966496353144747778470590767485019943178534397845127421058830430797806265311195099187747227867325234593386438995618936934586514932401108874934000734850169069717060963988677462779177959990601405850727404268354600078746523164279
    r = 2
    E1 = 1759982821354922353832044274649684283770977196846184512551517947600728059
    E2 = 13524024408490227176018717697716068955892095093578246398907145843636542721
    i = 1000
    max = 10000
    while(i <= max):
    P = (E1*i)+1
    if isPrime(P):
    j = 1000
    while(j <= max):
    Q = (E2*j)+1
    if isPrime(Q):
    if (N == P * Q ** r):
    print(f"Found ! P = {P} et Q = {Q}\n")
    break
    j += 1
    i += 1


    The purpose is to find the value of P and Q, I would like to mention that I'm a very bigenner so ^_~

    Continue reading...

Compartilhe esta Página