How to generate 1024-bit RSA key I have generated a prime number with a 1024-bit size.

Now, when I create an RSA key - how many bits does the key have?
By definition, an integer $a$ is $n$-bit iff $2^{n-1}\le a&lt;2^n$. It follows that the product of two $n$-bit primes is a composite of $2n$ or $2n-1$ bits.

In order to generate an RSA key of $2n$ bits, it is customary to generate two $n$-bit primes each at least $2^{n-1/2}$; this ensures that their product is at least $2^{2n-1}$, thus exactly $2n$-bit.

$1204$ or $2408$ bits would be unusual RSA key sizes. $1024=2^{10}$ bits used to be common, $2048=2^{11}$, $3072=3\cdot2^{10}$, and $4096=2^{12}$ bits are common modern sizes.