Jump to content
Byte-ul

Codul secret

Recommended Posts

Gigel crede ca a gasit un cod mega secret ascuns intr-un mic fisier text.

Continutul fisierului este urmatorul:


1147 7
780 629 1035 82 1003 791 277 548 562

Solutia pe PM. Postez hinturi pe parcurs.

Hint 1:

Gigel si-a dat seama ca fisierul era corupt atunci cand l-a copiat si lipsesc cateva caractere. A folosit un soft slabut de recuperare si a ajuns la urmatorul text:
N=1147 7
780 629 1035 82 1003 791 277 548 562

Hint 2:

Gigel a apelat la o firma specializata in recuperare date. Recuperarea nu a avut prea mult succes, insa s-a reusit gasirea a inca 2 caractere.
N=1147 e=7
780 629 1035 82 1003 791 277 548 562

Au rezolvat:

@theeternalwanderer

Edited by Byte-ul
Link to post
Share on other sites

#!/usr/bin/env python

import random

N = 1147

e = 7

code = [780, 629, 1035, 82, 1003, 791, 277, 548, 562]

prime = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67,

71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113,

127, 131, 137, 139, 149, 151, 157, 163, 167, 173,

179, 181, 191, 193, 197, 199, 211, 223, 227, 229,

233, 239, 241, 251, 257, 263, 269, 271, 277, 281,

283, 293, 307, 311, 313, 317, 331, 337, 347, 349,

353, 359, 367, 373, 379, 383, 389, 397, 401, 409,

419, 421, 431, 433, 439, 443, 449, 457, 461, 463,

467, 479, 487, 491, 499, 503, 509, 521, 523, 541,

547, 557, 563, 569, 571, 577, 587, 593, 599, 601 ]

while True :

p = random.choice(prime)

q = random.choice(prime)

if p * q == 1147:

print p, q

break

p = 31

q = 37

m = (p-1)*(q-1)

print m

m = 1080

for d in range(1, 10000):

if (d*e) % m == 1:

print d

break

d = 463

for i in code:

dec = i**d %N

print chr(dec)

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...