7 ms·
Representing SHA-256 Hashes as Avatars
- rumblefrog 6y agoWould be more awesome if it could export as an image! Right now I'm just manually inspecting it and copying the entire <g> section.
- franky47 6y agoSomeone actually built exactly that while I was writing the article :) https://github.com/wzulfikar/hashvatar https://github.com/wzulfikar/hashvatar
- geoah 6y agoOne of the prettiest identicons I've seen. Since it doesn't seem to be lossy, I was wondering if it could be somehow adapted to something that could be scanned as a QR code. I guess the minor color shifts might be hard to get right, but maybe combined/replaced with some form of symbol inside rings to help, a dot/dash combination?
- geoah 6y agoI'll also leave here this very nice list of identicon implementations: https://github.com/drhus/awesome-identicons https://github.com/drhus/awesome-identicons
- kop316 6y agoAs a warning, this would not be good for colorblind people (such as myself). The "Hello, Hacker News!" Hash's middle ring has half it's ring that looks identical to me, and unless I looked carefully, that entire ring looked the same to me.
- franky47 6y agoWhat would you suggest as a solution ? I considered swapping Hue for Lightness in order to increase contrast changes. Would you be interested in testing out some variants ?
- floatingatoll 6y agoYour Hue choices are selected from a pool of 16 with various mutators applied. Hue alone isn't a viable path forward, so finding a translation of Hue to a non-Hue representation that doesn't worsen the diagram is essential. You could apply repeating surface textures inside each slice, rather than showing a solid color, so that Hue 1 shows repeating dots, Hue 2 shows repeating lines, Hue 3 shows repeating triangles. You could use a Braille-like 2x2 grid to represent the 4-bit Hue space as circles and lines within each slice. If you imagine that each slice has 4 walls, replacing the missing fourth wall of the innermost slices with the innermost corner, then you could map the binary representation of 2^4 hue (such as 0110) onto "bites" out of the walls. For example, given 0110, map the 0s onto "bites" and punch a small hole into two adjacent walls of the slice; given 0000, punch a small hole into all four walls. ASCII art of what I mean by "punch a hole into the wall", for Hue 0111 (one zero, so one hole punched). This is an uncurved slice, because ASCII art. ____________ | | | __ | |____/ \____|
- franky47 6y agoThat's a great suggestion, I love the "hole punching" idea (although it'll probably end up looking like Swiss cheese). The key is to find a solution that looks good enough when zoomed out to ~64px square, which is tricky for details, especially in the inner ring where sections are packed so close from one another.
- floatingatoll 6y agoI imagine that's why square hashes are more common than circles: the raw information density problem.
- kop316 6y ago
- zellyn 6y agoSuggestion: shave off two bits, and switch between the variants in the "A bit of fun" section: https://francoisbest.com/posts/2021/hashvatars#a-bit-of-fun https://francoisbest.com/posts/2021/hashvatars#a-bit-of-fun
- RcouF1uZ4gsC 6y agoIt would be a lot more work, but it might work better if you picked something which humans are particularly tuned to notice subtle details such as faces.
- franky47 6y agoUsing the hash as a seed for an AI face generator like thispersondoesnotexist would be pretty powerful. Free idea for anyone who wants to give it a shot.
- capableweb 6y agoLook at that, you reinvented NFTs such as CryptoPunks :) https://www.larvalabs.com/cryptopunks https://www.larvalabs.com/cryptopunks
- raphlinus 6y agoI still like snowflakes for this: https://levien.com/snowflake-explain.html https://levien.com/snowflake-explain.html is a half-finished blog post explaining the motivation and algorithm I came up with. I never did careful user testing, but suspect that the answer would be that some people can reliably distinguish the patterns, others won't be able to. In any case, there are a lot of variations on this "visual hash" idea, including the original fractal one, and I heard of more recent work to use the hash to seed StyleGAN face generation.
- ianopolous 6y agoThis is a great idea! Trying random ones, I couldn't find two I thought looked confusable.
- mvolfik 6y agoTry changing just a few letters in the hash. If you change letters at the start, it changes drastically. But letters at the end change just small bits
- nemo1618 6y agoThe problem with hash avatars in general is that people want to use them for identity verification -- and humans are wired to do so automatically -- but technologically, they cannot provide this. The space of possible avatars (2^256, in this case) is far, far larger than the number of distinct objects that humans can distinguish between. Which means that there will invariably be "collisions:" two avatars that are not identical, but appear identical to humans. As a result, if an attacker can brute-force an avatar that looks very similar to, say, Elon Musk's avatar, they can trivially scam people. It follows that, since avatars do not provide any proof of identity, there is actually no harm in greatly truncating the hash space when generating them! That is, rather than trying to encode all 256 bits into the avatar, you can use a much more manageable number, like 16. But isn't this too small? Won't there be lots of collisions? Yes -- but that's a feature! If collisions are common, then the average user will be aware that avatar != identity, which makes them less susceptible to scamming. But 16 bits is still enough to meet the real goal of avatars: quickly distinguishing between different people in a conversation (or transaction, or whatever). (This also shows why making avatars more costly to generate, e.g. with scrypt, can do more harm than good: doing so makes collisions less likely, but still not impossible. Meaning that if a collision does occur, whether accidental or malicious, you are less likely to notice it.)
- sva_ 6y ago> The space of possible avatars (2^256, in this case) is far, far larger than the number of distinct objects that humans can distinguish between. That sounds intriguing to me. Are you aware of any research into this?
- nemo1618 6y agoTo be honest, I have no idea how many distinct objects humans can distinguish between, but I am 99% confident that it is fewer than 2^128, much less 2^256. I suppose it's a somewhat nuanced question, though. For example, if I were shown every avatar in sequence, I'm quite sure I would always notice the "diff" between two consecutive avatars. But the bar that I have in mind is much, much higher: given a sequence of avatars, can I recognize my friend's avatar with 100% accuracy? Given that we can't even do this within the set of <8 billion human faces (we occasionally accost a stranger as though they were a friend), I have to conclude that doing so within a set of 2^256 abstract shapes is entirely hopeless.
- sneak 6y agoSee also: https://robohash.org/ https://robohash.org/
- KingMachiavelli 6y agoDespite the issue where it would be trivial to brute force similar looking but not identical 'avatars', I think this still has a few good uses for non-identification. 1. Creating at least some default avatar. Not to be used to verify identity but just somewhat better than having a very limited set of default images. Having rate limits on account creation would prevent most brute force methods. 2. Avatar suitable for partial-identification for very small populations. Imagine a matrix/Element room that as <100,000 people. The hash/math could be modified to drastically trim down the space of the hash (e.g. 2^256) to something similar to the size of the room. #2 sounds pretty interesting. It could be expanded by making parts of the image/avatar dependent on some other input other than the user ID like the user's role in the chat group. Another segment/ring could something more short lived and relative like just identifying users in recent chat messages.
- tryonenow 6y agoWhat about training a GAN on a 256bit latent space? I wonder how large it would have to be to generate sufficiently differentiated avatars. May be impractical - but the spaces that they generate seem to be relatively continuous, so it could possibly work well enough.
- sm4rk0 6y agoStrange that neither the article nor the comments mention https://gravatar.com/ https://gravatar.com/ It hashes the user's email http://en.gravatar.com/site/implement/hash/ http://en.gravatar.com/site/implement/hash/ and creates an "identicon" from the hash http://scott.sherrillmix.com/blog/blogger/wp_identicon/ http://scott.sherrillmix.com/blog/blogger/wp_identicon/ or loads a user-defined image.
- leipert 6y agoI really like the former article method over the gravatar identicon because the circular shape is not going to end up with „accidental swastikas“
- toastal 6y agoI'd recommend the open and compatible Libravatar over Gravatar https://www.libravatar.org/ https://www.libravatar.org/
- franky47 6y agoI discovered robohash from Gravatar actually, but forgot to mention it, thanks for the reminder.
- EdSchouten 6y agoStill, these images are kind of hard to compare/remember. Why not convert a hash to a correct horse battery staple? https://xkcd.com/936/ https://xkcd.com/936/
- milkey_mouse 6y agoUrbit also developed a solution for turning a number into an avatar, although theirs only have 32 bits of entropy, and to be honest there are many that are difficult to tell apart: https://urbit.org/blog/creating-sigils/ https://urbit.org/blog/creating-sigils/
- mvolfik 6y agothese are pretty. Do you have any idea if there is a way to use the library with other data (hashes) other than the Urbit 'names' or what it is?
- milkey_mouse 6y agoThere is a JS sigil generator: https://github.com/urbit/sigil-js#basic-usage https://github.com/urbit/sigil-js#basic-usage And a Figma plugin: https://github.com/urbit/sigil-figma-plugin https://github.com/urbit/sigil-figma-plugin Urbit names are just another representation of a 32-bit number, like the sigils. You can use any 32-bit number as the "seed" for a sigil.
- joshbuddy 6y agoYou should check out this paper where they tested different representations on humans to see what they could tell apart, and came up with a novel representation called Moji. https://exascale.info/assets/pdf/students/MSc_Thesis_-_Michael_Luggen__14_09_2012.pdf https://exascale.info/assets/pdf/students/MSc_Thesis_-_Micha...
- petee 6y agoI always thought ssh randomart representations were visually unique enough; maybe combine smaller, simpler shapes with color too? The rings are neat, but I found many to be too similar based on color alone, and segments too are really hard pick up on a pattern or something memorable
- InfiniteCode 6y agoI did this one some time ago, allows custom visual effects using hash and seeded random: https://www.blankjs.com/ https://www.blankjs.com/
- tosh 6y agoWow, those are beautiful. Starred.
- InfiniteCode 6y agoThanks. I got tired of gravatar, wanted something customizable and to be used not only for avatars.
- tosh 6y agoHow about using the variants as well so the avatars also structurally look different from each other (and adding even more variants)?
- toptoppler 6y agoJust feed the hash into the thishumandoesnotexist Neural Network? Boom, human avatar.
- mvolfik 6y agoThat would be so creepy. Imagine a random face you've never seen in your life appearing as your avatar
- mrsharpoblunto 6y agoMakes me wonder if you could effectively apply Chernoff faces (https://en.wikipedia.org/wiki/Chernoff_face https://en.wikipedia.org/wiki/Chernoff_face) to make different hashes easier for humans to recognize. TLDR map parts of the hash to modify aspects of a face (position, size, orientation of eyes, ears etc.) and you can take advantage of all the in-built circuitry in the human brain which can identify very small differences in facial appearance. The idea is explored a bit in Peter Watts novel Blindsight - not for hashes, but visualizing high dimensional multivariate data via clouds of tormented faces :)
- ilammy 6y agoOpenSSH's randomart was too visually indistinctive for me so I've patched it to draw TrueColor images of cats. I wanted to actually seed a GAN to generate consistent images, but that turned out to be too much of a bother so I'm just keeping a local cache on a machine. Works nicely for that use-case as I'm able to associate a particular image with a particular location when working at a particular box. Good enough. https://github.com/ilammy/homebrew-ssh https://github.com/ilammy/homebrew-ssh
- irdc 6y agoHow hard would it be to instead generate faces with random facial features? Humans are already hardwired to be able to detect subtle differences between faces. That would obviously not make it suitable for generating avatars to identify humans, but it would make this really useful to eg identify git commits or hash signatures.
- emsign 6y agoAs a sidenote, your website breaks in Vivaldi with cookies denied and several ad-blockers. It keeps on reloading, making it impossible to close the tab or the browser. Please fix your site.