We present a general method of generating primes p and q such that q divides Φ n (p), where n > 2 is a fixed number. In particular, we present the deterministic method of finding a primitive nth roots of unity modulo q. We estimate the computational complexity of our methods.Keywords: primes of a special form, computing a primitive nth root of unity modulo primes, public key cryptography.