Primality Check is probably one of "those" tough problems in mathematics. So, whats is the best and fastest algorithm available to check the primality of a huge number. The most crude and the slowest way probably is:
public static bool IsPrime(int i)
{
for (var x = 2; x < i - 1; i++)
{
if (i % x == 0)
{
return false;
}
}
return true;
}
Recently I have read that the 768-bit RSA algorithm has been cracked using brute force, using a grid computing array. How do they perform the brute force on a huge prime number? Do each processing unit take up a series of number, factor it and check for primality all the number which lies in that range?