Piero V.

Certificate auth on WeeChat with a passphrase

In the latest months, I have been using IRC almost daily.

Before, I had used it only a few times. I only knew that this protocol is old, actually older than me 😄.

And I immediately saw that it lacks many of the features of modern systems.

Certificate authentication

One above all is registration and authentication. Many networks implement it through the NickServ user.

However, the authentication would involve sending the password as a message. Therefore, another mechanism based on a self-signed certificate is often preferred.

I am on OFTC, and t hey have a guide, which I initially followed (except for the algorithm: I changed rsa:2048 with ed25519).

Beware that this command does not ask for a passphrase! This was good enough for me since I was running HexChat on my PC, on which I use full-disk encryption.

You may want to encrypt the private key instead, and it is best to do it at the creation time.

Offline messages

But sadly, IRC does not have a feature that many (me included) take for granted today: offline messages. … [Leggi il resto]

Constructive Solid Geometry in JS

From time to time, I like playing with 3D graphics, especially from a programmer’s point of view.

Constructive solid geometry, or CSG, is a modeling technique involving combining simpler objects with Boolean operations to obtain more complex ones.

A while ago, I found an implementation as a JavaScript library: CSG.js.

It really is brilliant because it is a complete tool in less than 600 rows, half of which are explanatory comments.

Its foundations are the clipping and the inversion operation. The former removes parts of a BSP tree inside another BSP tree, the latter swaps solid and empty space.

CSG.js combines them cleverly to implement Boolean union, subtraction, and intersection.

Even from a software engineering perspective, its author made some acute choices. And as a result, this project did not need to be updated in the latest ten years!

For example, library users can implement vertices with custom properties thanks to duck typing. They just need to implement a few methods and have a pos member. In this way, it is possible, for instance, to manage texture coordinates. … [Leggi il resto]