Abstract. Safe primes and safe RSA moduli are used in several cryptographic schemes. The most common notion is that of a prime p , where is also prime. The latter is then a Sophie Germain prime. Under appropriate heuristics, they exist in abundance and can be generated efficiently. But the modern methods of analytic number theory have – so far – not even allowed to prove that there are infinitely many of them. Thus for this notion of safe primes, there is no algorithm in the literature that is unconditionally proven to terminate, let alone to be efficient. This paper considers a different notion of safe primes and moduli. They can be generated in polynomial time, without any unproven assumptions, and are good enough for the cryptographic applications that we are aware of.