RE: [Algorithms] Message signature in token ring
Brought to you by:
vexxed72
From: Tony C. <to...@mi...> - 2003-04-15 21:04:37
|
>How do people generate these really prime large numbers and relative primes, anyway? Simple brute=20 >force? Does the choice of prime numbers affect the security of the algorithm? (Does their magnitude >affect the security?) Actually, they don't. Confirming for certain that you have a prime number is a very hard problem. However, you can determine that the probability of your number being composite is below any given threshold you like (there are well-known algorithms for this), the longer you run for, the more sure you can be. Once your probability of having a composite falls below one in age-of-universe/protons-in-galaxy/days-until-Duke-Nukem-Forever-ships/yo ur-big-number-of-choice, you're happy with it. If you're interested, some quick Googling should reveal some implementations of RSA, including key generation, which will give you the idea (but please don't trust random code you trawled from the net, even if not malicious, it may be buggy in subtle ways not immediately obvious). The magnitude of one of the primes in RSA is a factor in the security of the system (because that's effectly what dictates the size of the number an attacker would have to factor to break the system). However, I would like to very strongly restate my observation that you really really really shouldn't be doing this yourself. It's easy to get wrong even for an expert in crypto algorithms (and, no offense, but it doesn't sound like you are an expert). Any decent OS will provide perfectly good implementations of these core algorithms (for example, the Crypto API in Windows), I highly recommend you use them. Tony Cox - Development Lead, Hockey Microsoft Games Studios - Sports |