hi all, suppose we have two numbers, one is serial added(about 8~10 digits), another is a random number(about 7~12 digits), then how can i generate a 5 digits number depends on both of them? there shouldn't have any key so i can verify the 5-digit number later just use the pervious two numbers, i know the security is completely depends on the method that how to generate this 5-digit number. any good method you all can hint me? any good random number generator? TIA. Kenix
At 09:52 AM 11/2/00 +0800, Kenix wrote:
hi all, suppose we have two numbers, one is serial added(about 8~10 digits), another is a random number(about 7~12 digits), then how can i generate a 5 digits number depends on both of them? there shouldn't have any key so i can verify the 5-digit number later just use the pervious two numbers, i know the security is completely depends on the method that how to generate this 5-digit number. any good method you all can hint me? any good random number generator?
This is called hashing. There are lots of ways to do this. If you need cryptographic strength, use a cryptographically strong hash function like SHA1 and keep 5 digits of output. If you don't need cryptographic strength, use a CRC code (Cyclic Redundancy Check). There are lots of books out there with theory or examples about CRCs and cryptographic hashes. The basic differences are how easy it is to predict differences in the input given different outputs - in cryptography you care about this being hard, while for regular applications you just care that different inputs usually give different outputs so everything's distributed evenly. Thanks! Bill Bill Stewart, bill.stewart@pobox.com PGP Fingerprint D454 E202 CBC8 40BF 3C85 B884 0ABE 4639
This is not a very good place to ask these sort of questions because (a) the list is meant to be about the use and politics and economics of crypto-technology (b) loads of people and (c) well... I could tell you half a dozen ways but I would be making it up and you ought not to trust me. There are mailing lists and newsgroups more directly about the details of cryptography. Check out some maths books in a library. Or try to find a copy of Bruce Schneier's Applied Cryptography book. Or use your search engine of choice to find web pages discussing "hashing algorithms", "checksums", "authentication", & the like. Ken Brown Kenix wrote:
hi all, suppose we have two numbers, one is serial added(about 8~10 digits), another is a random number(about 7~12 digits), then how can i generate a 5 digits number depends on both of them? there shouldn't have any key so i can verify the 5-digit number later just use the pervious two numbers, i know the security is completely depends on the method that how to generate this 5-digit number. any good method you all can hint me? any good random number generator?
TIA. Kenix
On Thu, 2 Nov 2000, Kenix wrote:
suppose we have two numbers, one is serial added(about 8~10 digits), another is a random number(about 7~12 digits), then how can i generate a 5 digits number depends on both of them? there shouldn't have any key so i can verify the 5-digit number later just use the pervious two numbers, i know the security is completely depends on the method that how to generate this 5-digit number. any good method you all can hint me? any good random number generator?
It's rather obvious, but: ABmod(b^n) Where A and B are your seeds/keys. b is the number of elements in the alphabet. n is the number of digits you want in the answer. You could add a trusted hashing function in there as well, (Hash(AB))mod(b^n) Hope it helps. As to random number generators, I'm fond of the radioactive and the physicaly chaotic sort (they tend to be non-transportable and rather large). Drip rate and magnetic pendulums being my favorite. ____________________________________________________________________ He is able who thinks he is able. Buddha The Armadillo Group ,::////;::-. James Choate Austin, Tx /:'///// ``::>/|/ ravage@ssz.com www.ssz.com .', |||| `/( e\ 512-451-7087 -====~~mm-'`-```-mm --'- --------------------------------------------------------------------
participants (4)
-
Bill Stewart
-
Jim Choate
-
Ken Brown
-
Kenix