28 June 2010, 19:26 | #21 | |
Registered User
Join Date: Oct 2009
Location: Germany
Posts: 3,307
|
Quote:
|
|
02 July 2010, 13:44 | #22 | |||||||||||||||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
And this is having a very limited number of seeds. Time is better for seeding. Quote:
Not to mention that instruction timing is complex enough to be difficult to predict (especially when cache misses occur). Predicting my RNG would need a cycle accurate emulation of the machine it runs on, while exactly knowing the initial machine state ! And this includes not only the CPU, but also the cias and the display HW (i'm reading beam couters, too). Quote:
You haven't seen any encryption code in your life, have you ? I perhaps still have the sources of PGP somewhere. Maybe a good read... Quote:
Because most of them get one seed, then make fixed, predictable computations based on it, while mine re-reads timers on the fly. Quote:
Quote:
Quote:
Quote:
And you needn't extremely complex algorithms to achieve this. Quote:
If timing variations are higher than the timer's resolution, then it's enough - and it is the case. Quote:
Quote:
Quote:
Oh, well, ok. I knew of a guy who was said to be often throwing 20's at first try, regardless of the used die... |
|||||||||||||||||
03 July 2010, 21:53 | #23 | ||||||||||||||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,810
|
Quote:
Quote:
That's how it looks, I know. The point is that I personally can't think of a reason why it wouldn't be random. Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
By the way, sorry for all the proof stuff, but the problem here is that it's very difficult to prove this kind of thing. |
||||||||||||||||
03 July 2010, 21:57 | #24 |
HOL/FTP busy bee
Join Date: Sep 2006
Location: Germany
Age: 46
Posts: 31,846
|
No offense meynaf and Thorham, but do you really need to make another excessive multi-quote thread? These are just a pain to read Maybe there's a way to post just what you want to say, instead of quoting each line individually.
|
03 July 2010, 22:45 | #25 |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,810
|
Meynaf, I've generated a nice image based on your seeding algorithm. Simply by calling it in a loop and copying the seed to a table and converting the data to an image. The image is in the zone.
When you see this image, you'll notice the high regularities immediately. Note that mouse clicks aren't included because I didn't click anything while generating the table, but as you'll see, it wouldn't have mattered that much anyway. The problem isn't just limited to regularities. Another one is that your seeding algorithm might be unable to produce all possible seeds. I think you should try and change this seeding algorithm. Perhaps, but only if this is preferred by most people. Personally I don't like it too much, though, and I'm a big fan of the quote function. |
05 July 2010, 11:27 | #26 | ||||||||||||||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
Just do it ;-) Very good, perhaps not, but better certainly. Quote:
Quote:
No. But you don't have the opposite proof either. Quote:
Quote:
Quote:
Quote:
Quote:
Frankly if i could avoid this multi-quoting, i would do it. But how to answer a message point-per-point without doing so ? My "see above" and "see below" will try to reduce the number of quotes nevertheless. Now Thorham has to follow... Quote:
Now do your image again with both the seeding algorithm called once at startup and the normal random generator (this time posting your image generation code as well). Then we'll see. |
||||||||||||||||
05 July 2010, 11:56 | #27 | |
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,810
|
I'll keep this short, because my knowledge on this subject is too limited (should be highly apparent ).
Quote:
|
|
06 July 2010, 10:40 | #28 |
The Spanish Songstress
Join Date: Jul 2009
Location: Finland
Posts: 114
|
meynaf, you should look up "entropy extraction" (active field of study).
I don't think your timer-shuffling would stand up to scrutiny, if we consider cryptographically secure algorithms - however I'm far from an expert on the subject matter myself so can't claim anything specific. There are some tests which have to be met at minimum (next-bit test and state compromise extensions at least - can't remember others for now) for an algo to be even considered secure. |
08 July 2010, 09:05 | #29 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
Quote:
Quote:
It just needs to be statistically balanced, and unpredictable. So far it is. Of course i've seen the image, but the seed generator doesn't need to be a rnd generator itself. It's just here to add a few more noise. Quote:
Quote:
Do you have some links on the subject ? |
||||
08 July 2010, 17:07 | #30 | |||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,810
|
Indeed It's perhaps useful to read up on this subject.
Perhaps this: 'Without any patterns that can be recreated with an algorithm or otherwise, except by chance", or something along those lines. Quote:
Quote:
Quote:
Anyway, as long as you don't say that your RNG produces true random data, it's fine with me. You see, the amount of chaos you can create with the simplest of algorithms is fantastic. Even my simple three line algorithm does that (and is highly regular, except to the naked eye). The problem is making it truly random with out normal hardware RNGs. |
|||
08 July 2010, 18:41 | #31 |
The Spanish Songstress
Join Date: Jul 2009
Location: Finland
Posts: 114
|
Something I had "on-hand":
next-bit test stuff: http://www.scientiairanica.com/PDF/A...3/eghlidos.pdf attacks on prng in general, including state compromise extensions: http://www.schneier.com/paper-prngs.pdf EDIT: One interesting thesis article, which gives good and simple background for estimating entropy (in chap 3) and all that - could be adapted to evaluate your algorithm. Discusses the problem of finding proper source of randomness with enough data on a limited platform. http://is.muni.cz/th/39510/fi_d/dissertation_thesis.pdf Lots more (published papers on the subject) can be found if you go google. I'm not personally qualified (or interested enough) to judge their merits, so I leave that as an exercise for the reader. Just saying, that if someone wants to seriously make a cryptographically secure prng, there's some work to be done by the author before anyone will even bother to take a look at it seriously, and it is definitely not enough to just claim: "because I say so - there's the code, check yourself"[heavily paraphrased]. EDIT2: Please, do not take this the wrong way. The algorithms proposed are probably quite good enough for all "intended purposes". I just budded in as I saw claims on security without any qualifiers. If I can provide at least useful information what to look for, I'm happy. Last edited by Maccara; 08 July 2010 at 19:21. |
11 July 2010, 19:03 | #32 | |||||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
Quote:
I think i will run a few of them ! Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
|
|||||||
14 July 2010, 21:03 | #33 | ||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,810
|
Of course, but many PRNGs are predictable (apparently), only the cryptographic algorithms are extremely difficult to crack.
Yeah, you should. Quote:
However, for game purposes your algorithm seems a little on the slow side: 1) It reads three chipset registers and that is somewhat slow. My solution to this is to use just one in combination with a small (16 kilobyte) true random table. The timer value is simply added to the offset of the table, and the value read from there is the value you add to the state of the RNG. Then you simply don't do this for every call, but for every few calls. 2) It uses a slow multiply. 3) It uses a very slow division for mod. 4) It's a little big to inline in a loop. If you like optimized code, then you may want to look at these issues. My simple PRNG is only three lines, and can be inlined almost anywhere: Code:
rol.l #7,d0 add.l d1,d0 add.l #$11111111,d1 Quote:
@Maccara: Very good reading, thanks Last edited by Thorham; 16 July 2010 at 09:24. Reason: Code said rol.l #4,d0. Should be rol.l #7,d0. |
||
15 July 2010, 15:10 | #34 | |
old bearded fool
Join Date: Jan 2010
Location: Bangkok
Age: 56
Posts: 779
|
Drifting slightly out of topic perhaps, but thought it might be a fun Amiga project; using a Geiger counter to seed random value via the serial port.
Quote:
Source: http://www.imagesco.com/geiger/analo...r-counter.html The price is kind of steep, but it might also become useful when the atomic winter is upon us. |
|
17 July 2010, 14:53 | #35 | ||||
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
Quote:
But unfortunately all i've seen is using stupid float maths and never gives clear result. Quote:
Quote:
It's not enough for the RNG's speed to count much, unless it's several tens of times slower than mine. Speed isn't an issue here. It's for the example, not for practical use. Quote:
|
||||
17 July 2010, 15:44 | #36 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,858
|
my advise... just use a Zener diode or special noise diode - they generate flat noise - amplify noise (additionial source of noise), convert to digital by some ADC (additional noise)...
|
19 July 2010, 09:42 | #37 |
son of 68k
Join Date: Nov 2007
Location: Lyon / France
Age: 51
Posts: 5,350
|
|
19 July 2010, 18:22 | #38 |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,858
|
small AVR uC (embedded ADC + communication) + very simple analog circuit can give truly random data - this can be difficult to beat in pure software way (if possible at all) - Amiga except paddle interface (it can give some limited randomness due of way how it works) is lack of ADC - this limit randomness...
|
20 July 2010, 09:08 | #39 | |||||||
Computer Nerd
Join Date: Sep 2007
Location: Rotterdam/Netherlands
Age: 47
Posts: 3,810
|
Quote:
Quote:
Quote:
Quote:
Quote:
Quote:
They're the handiest, until you need true random numbers Quote:
|
|||||||
20 July 2010, 13:04 | #40 | |
Registered User
Join Date: Jun 2010
Location: PL?
Posts: 2,858
|
Quote:
FM noise is not always random (some interferences can be quite regular) Most modern FM receivers do auto-mute |
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Random question | 251Mario | project.EAB | 1 | 16 May 2013 02:19 |
HELP! A600 number 2 down! :( | Snowy | support.Other | 5 | 04 December 2011 22:12 |
Help needed!!Random octal numbers generator(asm) | sheryn88 | Coders. General | 6 | 01 August 2010 07:19 |
Random crashes | ami_stuff | support.WinUAE | 8 | 06 February 2009 16:51 |
D/Generation | IanMac | support.Games | 2 | 04 November 2002 16:47 |
|
|