Re: OT: RFC, PRNG




"Josiah Carlson" <josiah.carlson@xxxxxxxxxxxxx> wrote in message
news:BCk6i.9541$2v1.2979@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx
cr88192 wrote:
well, I lack much better place to ask about this.

for a project of mine, I have needed a fairly special PRNG. the point is
to have a sufficiently large amount of entropy that it generates
hopefully-unique strings.

additionally, it is important that the generated strings are different
each time the app is run, and are different between different
installations.

in general, I am using a 4096-bit state.
the state is preserved in files.

Don't guess, just use Mersenne Twister. Note that neither Mersenne
Twister, nor your algorithm, are technically guaranteed to not produce
duplicate strings of 96 bits. Then there's the other perspective that
will tell you, "just use /dev/urandom on *nix".


2 problems:
I don't like using other peoples' code if avoidable (I am fussy about this);
I don't have access to '/dev/urandom', because in part, I am currently
running on windows.

I am mostly just hoping that the probability of clashes is sufficiently low
that they are unlikely in practice (anything much beyond 1.0/2^32 would
probably be fine).

me just hoping this has sufficient entropy.

that is part of why I use a load, mutate, and save approach.
the hope is that with repeated runs the entropy will increase making it more
random.

another previous approach for comming up with random numbers (typically used
as seeds), was to do a bunch of tweaky behavior involving timing (ie: with
clock). the issue though is that this approach takes up some small amount of
time (but is at least fairly good about being random IME).


but, yeah, usually for things like this (small and simple) I write a
specialized version for each case where the need arises (and sometimes
different uses combine to form interesting occurances).

what I had hoped for was more commentary on the algo specifics, ie, any
obvious flaws, ...


In terms of your requirements (which sounds like a method for producing
variable names), generate a sequence of characters and sanitize it as you
go.


yeah, basically.

they are for compiler-generated names, aka a gensym mechanism.
in the past, I had used a special prefix and sequential numbers, but this
wont work if the files are stored externally.

sadly, schemes with a higher base, don't really save many chars.
base64 would save 2-chars over base48, but base32 would be 3-chars longer.

shorter names are better, but so is avoiding clashes, so it is a tradeoff...


- Josiah


.



Relevant Pages

  • Re: Good enough for crypto?
    ... >> of entropy. ... >> But when you are making adjustments, you are in fact using information ... >> When a system only contains a finite amount of entropy, ... Take the case where you have a closed chaotic system (this is ...
    (sci.crypt)
  • Re: Entropy in crystalization: up or down?
    ... available energy. ... simple, uniform, repeating structures with minimal complexity, and ... Does crystallization represent a decrease in entropy or no? ... entropy refers to the amount of energy in a system ...
    (talk.origins)
  • Re: The randomfunction
    ... >> There is a significant difference between the amount of energy ... >> required for a single mind to move a material object and that ... entropy is measuring the state and degree of the energy (e.g. ...
    (comp.programming)
  • Re: Encryption key longer than text to encrypt
    ... the entropy rate of the language ... when the amount of information in the plaintext ... exceeds the amount of information in the key, ... contradiction here. ...
    (sci.crypt)
  • Re: OT: RFC, PRNG
    ... the point is to have a sufficiently large amount of entropy that it generates hopefully-unique strings. ... additionally, it is important that the generated strings are different each time the app is run, and are different between different installations. ... Note that neither Mersenne Twister, nor your algorithm, are technically guaranteed to not produce duplicate strings of 96 bits. ...
    (comp.compression)