Lurker News
Hey HN, I didn't want my Gateway 4DX2-66 from 1993 to be left out of the AI revolution, so I built an AI Assistant for Windows 3.1, based on the OpenAI API.

The most interesting parts of building this were:
- Getting TLS 1.2 and 1.3 working on Windows 3.1 so that WinGPT could directly connect to OpenAI's server without relying on a modern machine for TLS termination.
- Learning about the memory segmentation architecture on 16-bit Windows, including the difference between far and near pointers.
- Building the UI in plain C code with the Windows API and limited selection of controls in Windows 3.1.
You can check it out here and learn more about what it was like to build it: https://www.dialup.net/wingpt/

Comments (90) 29 threads

Show all comments

Showing thread 7 of 29

grishka1 reply#
Native TLS is the most impressive part.

I remember being told that modern cryptography isn't usable on old CPUs simply because of the amount of unoptimizable number crunching involved. As in, some steps of the key exchange algorithm would take so long that the server would time out. But apparently that's not a problem for a 386 despite being old and slow?

Shawnj22 replies#
Considering how many embedded devices are in use, a lot of which are 8 bit microcontrollers with minimal RAM, designing systems that way would be irresponsible. There probably are some systems that don’t have an embedded use case that would (Eg. Encryption for live video) but not everyone is connecting to the internet on the newest iPhone.
grishka2 replies#
I've always had the impression that modern internet-connected (and I mean the public internet with TLS and all that, not just LAN) embedded devices use fairly beefy, and at least 32-bit, CPUs just for that reason. But the bits don't make as much difference as the clock speed, and that can go much higher in modern days thanks to the smaller node size.
Shawnj22 replies#
In 2023 yes but there are lot of in production systems designed in the past around older chip designs and old hardware in the real world with slower chips. For example a common low processing power network device you can still make easily today is an Arduino Uno with a network hat.

Continue this thread — 2 replies

kjs3#
There are "100 MIPS" 8051 variants (for some value of MIPS) like the Silicon Labs C8051F360. Not sure that's fast enough for 'modern web', but probably fast enough for a lot of interesting things.
kjs3#
One of the specific design requirements for the AES competition is that it could be used in embedded systems, which at the time was synonymous with 8-bits and limited memory. There are AES candidate 'reference' implementation floating around for the original AES bakeoff (that Rijndael eventually won) running in a couple of KB of memory for the 8051 and mc6805, for example, and I know of at least one PIC version of AES in use. There's probably tons of other examples; given how well documented the algorithm is, it's one of those things a lot of people probably take a swing at.

Now...this is obviously for sending small amounts of data at low (very) bit rates 'securely', not modern web or streaming or anything fun like that. And my understanding is that the real killer in trying to do something like TLS on such small platforms is the key generation/exchange/management part. YMMV.