home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!olivea!charnel!rat!usc!zaphod.mps.ohio-state.edu!cs.utexas.edu!torn!news.ccs.queensu.ca!mast.queensu.ca!dmurdoch
- From: dmurdoch@mast.queensu.ca (Duncan Murdoch)
- Newsgroups: comp.lang.pascal
- Subject: Re: Encryption and Random Numbers
- Message-ID: <dmurdoch.285.722096509@mast.queensu.ca>
- Date: 18 Nov 92 14:21:49 GMT
- References: <1992Nov17.211502.18511@lynx.dac.northeastern.edu>
- Sender: news@knot.ccs.queensu.ca (Netnews control)
- Organization: Queen's University
- Lines: 28
-
- In article <1992Nov17.211502.18511@lynx.dac.northeastern.edu> cschmidt@lynx.dac.northeastern.edu (Christopher Schmidt) writes:
- >Duncan Murdoch's interesting STREAMS package includes some
- >clever encryption logic that uses the TP random number
- >generator. It's a nice technique, except that if Borland
- >modifies the TP random number generator, then you and your
- >customers will be locked out of your encrypted data.
-
- That's a good point. I have Pascal code that is equivalent to the TP 6
- random number generator; I'll include it in the next Streams release. It's
- not nearly as fast as the real thing, so it'll be a conditional include,
- depending on the compiler version.
-
- Once I dig up the code, I'll post it here. You could figure it out yourself,
- pretty easily: It's of the form
-
- RandSeed := A*RandSeed + B;
-
- and I think B is 1. If you're using TP/BP 7, be sure to compile it with
- overflowchecking turned off. There's an implicit "mod 2^32" in there that's
- essential.
-
- Come to think of it, the new longint optimizations might make the Pascal
- version competitive with the RTL version. I'll have to do some timings.
-
- Duncan Murdoch
-
- Duncan Murdoch
- dmurdoch@mast.queensu.ca
-