Challenges
Small prime numbers
Cryptography
Easy
Factorization
Solves: 8
Small prime numbers
Author: CyberSamSU
Points
20
For RSA to be broken, it is enough to factor n into the form p · q. In real keys, n is 2048-bit and nobody can factor it. But in this challenge, the prime numbers are very small — around a million.
Such an n can be factored using the simplest method — trial division: we test every number from 2 up to √n. Here √n is around a million, meaning a simple loop will finish in a second.
Public key and ciphertext:
n = 520683504631
e = 65537
c = 465285493763
The decrypted number becomes a 4-byte text (for example m.to_bytes(4, 'big')). Put those 4 characters (they are random, not a meaningful word) into the flag.
Flag: BAYROQ{RS4_kichik_tub_<4_belgi>}
Theory: learn the topic
To submit a flag, log in.