# Rabin: how discover P and Q?

I'm really lost.

I'm creating a classroom lesson about Rabin encryption and I had understood the encryption process, the creation of public-key (N = p*q) and the steps I need to find the 4 values that can be the solution.

BUT, every sample I find consider the true P and Q to demonstrate the decryption process (Extended Euclidean or Euclidean) and most of them using p=7, q=11, N = 77!

I mean, how they have P and Q?

For instance: this and this and some other as in Applied Cryptography (section 8.12) and so forth.

Is the factoring of N the first step to calculate the secret-key?
Or the solution of trying random values to put into Chinese Remainder Theorem? I can't believe in this because doing so, I would be considering Bob like Eve (have to try a lot of values to get P and Q)!

Can you light my way? I appreciate in advance.

The intended users know, in fact choose $p,q.$ The attackers aren't supposed to know. Once you know $p,q,$ you use the Chinese Remainder Theorem for efficient computations.