|
RNG (Random Number Generator) There are so many people researching about this subject, this RNG is very important in IT industry, it is used in games, security, database, and a lot more. This is the RNG of my own implemetation, I do not want to discuss a lot of things about this random number generator, it is very simple even though I see some people making quite a big library (code) just to make this RNG, they have their own preferences and purposes. In my opinion, the main idea about RNG is that it must generates a different value each time for about at least 50% of the size of the value, and if it can reached up to more than 75% of the size then it is very excellent program, what I meant by this is if the program suppose to generates 32-bits value size then it must at least able to generates 31-bits (half, 50% of it) times successfully different values, eg. the max value of 32-bits is 4,294,967,296 and the half of it is 2,147,483,648, so if the program generates a same value within 2,147,483,648 times then it is not a good RNG, its life cycle length is sort. Below is the code that I used in my RSA 2048-bits Encryption program, I welcomed anyone to give me feedback about the result of this algorithm or criticize this algorithm. This RNG algorithm is based on time, the reason I use this are:
// The value of SEED can be initialized to any value if prefered, to
avoid hacker void random_init(__int32 init) {
} unsigned __int32 random(void) {
} Should this algorithm imposed a bad result I will change the algorithm or create a better algorithm for the RNG of this RSA program. I need your feedbacks. |
|
|
Author
Site Map Disclaimer
HMaxF Ultimate Recursive Lossless Compression Research 2001 - 2003 (c) All Rights Reserved. |
|