Live data from Hacker News

A TLS 1.3 stack written in Visual Basic 6

github.com

1–10 of 101 posts

Re: A TLS 1.3 stack written in Visual Basic 6

#4
It's less than 8kLoC, including what seems to be a bunch of tests at the end, although much of the actual crypto appears to be done using the native advapi32/crypt32/ncrypt libraries. (For those used to OpenSSL, I suppose this could be compared to the libssl part of it.)

Re: A TLS 1.3 stack written in Visual Basic 6

#5

It's less than 8kLoC, including what seems to be a bunch of tests at the end, although much of the actual crypto appears to be done using the native advapi32/crypt32/ncrypt libraries. (For those used to OpenSSL, I suppose this could be compared to the libssl part of it.)

Yep, one of the features of VB was you could call into Win32 fairly easily.

I once worked with a guy who was a VB savant. He had reverse-engineered the DOC and PST formats in Visual Basic and was comfortable bit-bashing stuff in that environment. His higher-level code was really not good, that wasn't important to him, so he pasted stuff everywhere. Lost track, but hope he found his niche.

Re: A TLS 1.3 stack written in Visual Basic 6

#7
wqweto is a genius. Check out his twinbasic project, 99% similar to VB6 with a bunch of extras, modernising the language. Shout out to all the VB6 legends still going at it and extending the language, wqweto, the trick, olaf, retailcoder.

Re: A TLS 1.3 stack written in Visual Basic 6

#8
I fell out of my chair into a fit side-splitting chuckling.

Hey, VB6 is ~~free real-estate~~ Turing complete, although maybe just barely.

If a quine transpiler between JS and PHP and VB6 existed, all things have happened, AI has won, and we can go back to typewriters and candles.

Re: A TLS 1.3 stack written in Visual Basic 6

#9
post #5

It's less than 8kLoC, including what seems to be a bunch of tests at the end, although much of the actual crypto appears to be done using the native advapi32/crypt32/ncrypt libraries. (For those used to OpenSSL, I suppose this could be compared to the libssl part of it.)

Yep, one of the features of VB was you could call into Win32 fairly easily. I once worked with a guy who was a VB savant. He had reverse-engineered the DOC and PST formats in Visual Basic and was comfortable bit-bashing stuff in that environment. His higher-level code was really not good, that wasn't important to him, so he pasted stuff everywhere. Lost track, but hope he found his niche.

I think we all have similar stories of tools like VB being pushed far beyond their original purpose by someone with enough motivation, and creating perfectly functional, yet extremely unconventional code. Here's another example I found in my links of old interesting web stuff --- a server for the MMO Habbo Hotel, written by (at the time) a teenager:

https://files.johno.uk/habbo/h4bbo.net/archive/HabboStuff/Mo...

Re: A TLS 1.3 stack written in Visual Basic 6

#10

It's less than 8kLoC, including what seems to be a bunch of tests at the end, although much of the actual crypto appears to be done using the native advapi32/crypt32/ncrypt libraries. (For those used to OpenSSL, I suppose this could be compared to the libssl part of it.)

The big lines of code in TLS is x.509 certificate parsing, and supporting multiple protocols. If you just want 1.3 and you've got existing cipher and certificate validation libraries to call, it's not too bad. There's some published test vectors to help you get the cipher setup right as well; it gets fiddly, but it's not going to be a lot of code unless you have an Object Extravaganza, and even then, still not too bad.
Post reply on HN