Email: Password: Remember Me | Create Account (Free)

Back to Subject List

Old thread has been locked -- no new posts accepted in this thread
???
10/29/09 16:43
Modified:
  10/29/09 17:06

Read: times


 
#170211 - Quality often important even for simple devices
Responding to: ???'s previous message
If no hw noise generator is available, I do recommend a normal pseudorandom generator as already discussed here for low-end requirements.

If there is any the slightest needs for security etc, then a better solusion would be needed. Something at least making use of true true asynchronous events - possibly by additional hardware just for this use, in case the product doesn't have natural ways to receive the required amount of randomnes.

But the ping time of a packet, or the receive time of a character in relation to a free-running timer, only gives very few bits of random data. The received character may result in a read out of a 16-bit or 32-bit counter, but the size of the counter can't help the fact that the time of the character arrival can be measured. And the random jitter for an ISR is not so high. And a block of data sent continuously from a FIFO-enabled transmitter will not introduce any real jitter between characters.

One little cheaty thing to remove cycles in random data can be to xor the random data with bytes from the code flash. If the code block contains a lot of 0x00 or 0xff, then it will send through the data unchanged or inverted which isn't reducing the quality of the emitted sequence. Blocks of code that contains random machine instructions will invert random bits from the pseudo-random sequence. If there is free flash space, then a real table of one or more kB of random data can be stored for use to invert the data from the pseudo-random sequence. But it is important that the code region used is not sized as 2^n. Selecting a prime number as the size of flash data to xor with the pseudo-random sequence makes the repetition cycle way longer.

Edit: Just two footnotes.

1) If it is important that people can't look at the random number sequence to try to extract machine instructions from the flash, then any xor operation should make use of a dedicated table of random data instead of using a memory region with instructions.

2) Another thing to consider if using a processor that isn't too RAM-limited is to have a reasonably large mixing buffer in RAM. Each asynchronous event is then used to get a couple of bits of random data that is exored with this table in a round-robin fashion, constantly changing the contents.

When random data is needed, then the pseudo-random generator is used, and the result is xored with the random table in a round-robin fashion.

If the table is 1kB large, and there are enough asynchronous events to keep it refreshed faster than what is consumed, then it will be very hard to try to duplicate the full state machine.


List of 67 messages in thread
TopicAuthorDate
Random numbers            01/01/70 00:00      
   How random?            01/01/70 00:00      
   extract?            01/01/70 00:00      
      Time for Google            01/01/70 00:00      
      Extract            01/01/70 00:00      
   you can't            01/01/70 00:00      
      a very good way to get random numbers            01/01/70 00:00      
      Interesting anecdote regarding timers:            01/01/70 00:00      
      Periodicity            01/01/70 00:00      
   Just curious...            01/01/70 00:00      
      Didn't search first!            01/01/70 00:00      
         New Information not searchable            01/01/70 00:00      
            Using life itself as part of its computational matrix...            01/01/70 00:00      
               Sure it is            01/01/70 00:00      
         Show me any real new thread...            01/01/70 00:00      
            But...            01/01/70 00:00      
               It really means...            01/01/70 00:00      
                  No "Come In!", but a "Go Home!"            01/01/70 00:00      
                     Exclusive information...            01/01/70 00:00      
                        Thanks...            01/01/70 00:00      
                        First and ONLY Time I reply to this            01/01/70 00:00      
                           Completely ridiculous might be a bit strong            01/01/70 00:00      
                           Lazyness...            01/01/70 00:00      
                              ...is already ignored            01/01/70 00:00      
                                 But we restrict ourselves!            01/01/70 00:00      
                                    No, you are restricting the definition of "help"            01/01/70 00:00      
                                       Your propaganda again...            01/01/70 00:00      
                                          People ARE posting code snippets etc            01/01/70 00:00      
                                             Come on, how many do so?            01/01/70 00:00      
                                                Do what?            01/01/70 00:00      
                                          The limiting factor            01/01/70 00:00      
                                             Mixing subjects            01/01/70 00:00      
                                                Not a valid answer            01/01/70 00:00      
                                                   Are we poluting this thread?            01/01/70 00:00      
                                                      Yes, but Roberto has gone already...            01/01/70 00:00      
                              true for good schools, but not for diploma mills            01/01/70 00:00      
                     Balance            01/01/70 00:00      
                        Warding people away is no good policy either            01/01/70 00:00      
                           Bully for seeing problems with negative votes???            01/01/70 00:00      
                              Its his will            01/01/70 00:00      
                              Its just a biginning!            01/01/70 00:00      
                                 Still extrapolating            01/01/70 00:00      
                                    Relativity?            01/01/70 00:00      
                                    Extrapolating What            01/01/70 00:00      
                                       Not a valid conclusion!            01/01/70 00:00      
                                       Still extrapolating            01/01/70 00:00      
                           Wrong link?            01/01/70 00:00      
                              link to link            01/01/70 00:00      
                                 But nothing about fear of 8052.com?            01/01/70 00:00      
                                    At least,...            01/01/70 00:00      
   This method might work...you can try it....            01/01/70 00:00      
      Unnecessary complication!            01/01/70 00:00      
         Watch out for distribution problems for small ranges            01/01/70 00:00      
         Yes..But for added randomness, use the table            01/01/70 00:00      
            Incorrect - the table adds nothing!            01/01/70 00:00      
               Quality often important even for simple devices            01/01/70 00:00      
                  can be dangerous            01/01/70 00:00      
                     Bus arbitration needs a lot            01/01/70 00:00      
            HUH????            01/01/70 00:00      
      he can't            01/01/70 00:00      
      Modulating the /INT0 input by a simple noise generator            01/01/70 00:00      
         Post-processing needed            01/01/70 00:00      
            What interrupt?            01/01/70 00:00      
               Both interrupt or gating possible            01/01/70 00:00      
                  Full agree with everything you wrote!            01/01/70 00:00      
         Addendum...            01/01/70 00:00      
   Google as a resource?            01/01/70 00:00      

Back to Subject List