## Random Value[Back] In RSA we generate two prime numbers. Often these are guarantee from 512-bit value and give values of p and q. The result is then (p-1)*(q-1) which gives a 1,024 bit value.
## CodeBigInteger a,b,c; SecureRandom random = new SecureRandom(); do { a = new BigInteger(512, random); c= a.Mod(new BigInteger("2")); b = new BigInteger("0"); } while ( b.ToString() == c.ToString()); String g= InsertComma(a.ToString()); |