Generate keys more carefully, so that when the user asks for an n-bit