Generate an insecure public / private key pair
I am not sure to fully understand your question, but what you can do is the following: take $r=2^{512}$, and compute $p=r+\delta$ and $q=r-\delta^\prime$ such that $p$ and $q$ are prime numbers, and $0\leq \delta, \delta^\prime &lt; 2^{32}$. Then you have an RSA key at you disposal that can be broken by a brute force search on $\delta$, which should take strictly less than $2^{32}$ trials.