Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Creating a CSPRNG for DOS? (Developers)

posted by rosegondon, C:\DOS, 01.06.2024, 18:27
(edited by rosegondon on 03.06.2024, 21:09)

> In the hope of getting a good answer. I'm currently thinking about
> cryptographically safe random number generator for DOS. In the general
> sense, and not DOSBox specific.
> [...]
> So what strategies are good, which are bad, and what are my options?

1. If you ditch the necessity of constant reseeding (djb's philosophy of "Fast-key-erasure random-number generators", https://blog.cr.yp.to/20170723-random.html) then just hash the DOS memory and some volatile hardware states with Keccak and pass the output (with tailored size) to your favorite CSPRNG.

2. If you prefer the constant reseeding philosophy, then plagiarize NOISE.SYS:
https://github.com/robrwo/noise.sys - my recommendations for "NOISE.SYS 2.0" core are then:
a. HMAC-DRBG http://nvlpubs.nist.gov/nistpubs/SpecialPublications/NIST.SP.800-90Ar1.pdf
b. Fortuna https://en.wikipedia.org/wiki/Fortuna_(PRNG)
c. Hybrid https://www.cryptosys.net/rng_algorithms.html

In this version don't sweat too much over sources selection: just use ALL of them. Some of them will be bad under emulation/virtualization, but each and every one of them will add to the final entropy anyways.

In my personal opinion, djb assumptions are too optimistic and I would prefer option 2.

---
echo g=ffff:0|debug>nul

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 108 users online (0 registered, 108 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum