Creating a CSPRNG for DOS? (Developers)
> 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:
- Creating a CSPRNG for DOS? - myrkraverk, 01.06.2024, 14:50 (Developers)
- Creating a CSPRNG for DOS? - rosegondon, 01.06.2024, 18:27
- Creating a CSPRNG for DOS? - myrkraverk, 02.06.2024, 01:14
- Creating a CSPRNG for DOS? - SuperIlu, 02.06.2024, 14:11
- Creating a CSPRNG for DOS? - myrkraverk, 03.06.2024, 09:09
- Creating a CSPRNG for DOS? - SuperIlu, 02.06.2024, 14:11
- Creating a CSPRNG for DOS? - myrkraverk, 02.06.2024, 01:14
- Creating a CSPRNG for DOS? - rosegondon, 01.06.2024, 18:27