After the server and the client have connected, the idea is to create a new Identicon from the server and the client address. This derives a short string with seven chars from [A-Z0-9]. This string is rendered in 3 different colors—the base is provided by the marble-identicons package. I decided to use this as it has minimal dependencies and can, in addition to this, render text onto the identicon.
We get roughly 235 billion combinations (3*36^7) with the approach above. This is just for the text; the background gradients increase this number exponentially, so two clients generating the same image is unlikely.
To verify the connection between the client and the server is the same, I suggest using an identicon.
With a given hash known to the server and client, we can generate an image that is easier to compare for the human eye.
I added the PR https://github.com/fabianbormann/cardano-peer-connect/pull/15, which implements such a feature. In addition, this pr also adds the function to the demo implementation.
After the server and the client have connected, the idea is to create a new Identicon from the server and the client address. This derives a short string with seven chars from [A-Z0-9]. This string is rendered in 3 different colors—the base is provided by the marble-identicons package. I decided to use this as it has minimal dependencies and can, in addition to this, render text onto the identicon.
We get roughly 235 billion combinations (3*36^7) with the approach above. This is just for the text; the background gradients increase this number exponentially, so two clients generating the same image is unlikely.
Here are three examples.