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 myrkraverk, 01.06.2024, 14:50

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.

For random seeding, I'd like to hook the kbd interrupt, or maybe some of the auxiliary interrupts for the BIOS, maybe the mouse as well, and/or the clock. If possible, network and other I/O such as serial.

The reason I'm overthinking this, is that I'm currently thinking of command line tools, rather than full screen applications, and that means having a CSPRNG that updates its seed between invocations, if possible.

If I were only thinking of a full screen application, I'd just hook the kbd interrupt, and hope the user types enough to have a good seed.

Implementing Fortuna is the easy part; it's hooking the various "noise sources" and doing that in a way that can be small enough to not interfere with most of the DOS programs out there that require a lot of conventional RAM. Another consideration is to do it in a way that works both on real hardware, and emulators such as DOSBox because someone's going to run it in a basic emulator eventually. And that means not relying on features only present in DOSBox-X or such.

So what strategies are good, which are bad, and what are my options?

 

Complete thread:

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