Live data from Hacker News

Your hex editor should color-code bytes

simonomi.dev

131–140 of 165 posts

Re: Your hex editor should color-code bytes

#131
post #65
post #63

DEFCON30, Mayhem CTF. We were given a file full of random bytes. The flag was in there somewhere. It was too random to be encrypted, there wasn't any structure. `file` didn't return anything, truly just a bag of bytes. I had decided to install `hexyl` as an alternative option to some of the other hex editors installed o my linux machine. All the bytes were colored grey. I scrolled the file and noticed a blip of yello…

> It was too random to be encrypted That's a rather odd remark.

It's not?

Compare a random data from a pseudo gen, a really random data and some encrypted data. They are all different.

Re: Your hex editor should color-code bytes

#132
post #35

Everything should try do some basic syntax highlighting IMO. Not too much, or it just becomes a sea of formatting that doesn't help at all. It is surprising how much difference just a little splash of colour can make if it isn't overdone. If possible, always include configuration options for the user though, so those with colour-blindness issues can tweak things to their needs, those who are just fussy can make the o…

I'd recommend for every developer to get one or more colourblind friends. I have some, and regularly send them screenshots of what I'm working on to get feedback what they can see and what they can read/can't read. They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

Ubisoft release some tools to simulate colorblindness. It's easy to extract de color transformation from their shader directly. I'm not colorblind but I use that quite often to check roughly if the color palette I choose is fine https://github.com/ubisoft/Chroma

Re: Your hex editor should color-code bytes

#134
post #38

What a bad way to illustrate your point by using such similar looking pastel colours

Ironically, my complaint about the article was that the author apparently only uses typical human vision ranges here, rather than mapping 00..FFh onto an OKlab gradient of hue 0..359° that rewards those few of us with impeccable color fidelity with even better highlighting than most can see :) No doubt there’s value in contentful highlighting but I’d rather just have a straight hue translation on the circle at a fixe…

for the record, i did use OKlab to pick my colors ! (see the CSS for my site https://github.com/simonomi/simonomi.github.io/blob/aa55ea85...) i'm not opposed to using a unique color per byte, but i didn't want 256 different CSS classes for byte coloring, so i manually picked the 16 most distinct hues i could

Re: Your hex editor should color-code bytes

#135
post #69
post #35

Earlier quoted context omitted.

I'd recommend for every developer to get one or more colourblind friends. I have some, and regularly send them screenshots of what I'm working on to get feedback what they can see and what they can read/can't read. They've been absolutely invaluable for making sure their kind of people can't use my apps properly.

Pro-tip: there are browser extensions able to simulate various kinds of color blindness. That is better then a random friend, because a.) there are various kinds of colorblindness b.) you wont ask the random friend to work for your company for free.

On the other hand, the random friend generally has a great deal of experience with what interventions help and don't help.

A filter shader generally won't tell you that substituting white for green in a red/green indicator is a great option, or that a colour that they can “see” is still ambiguous when you have to describe it: “I'm clicking the purple button, but it's not doing anything” “Purple? There's no purple in the app!”

Re: Your hex editor should color-code bytes

#136
post #115

Earlier quoted context omitted.

Some people lack in vision, some lack in reading and some lack in stopping themselves to reply to comments misunderstanding others.

[flagged]

gortok lack in vision. You lack in reading. And I lack in stopping myself to reply to comments misunderstanding others.

I love that I had to explain this :)

Re: Your hex editor should color-code bytes

#137

Earlier quoted context omitted.

Ironically, my complaint about the article was that the author apparently only uses typical human vision ranges here, rather than mapping 00..FFh onto an OKlab gradient of hue 0..359° that rewards those few of us with impeccable color fidelity with even better highlighting than most can see :) No doubt there’s value in contentful highlighting but I’d rather just have a straight hue translation on the circle at a fixe…

for the record, i did use OKlab to pick my colors ! (see the CSS for my site https://github.com/simonomi/simonomi.github.io/blob/aa55ea85... ) i'm not opposed to using a unique color per byte, but i didn't want 256 different CSS classes for byte coloring, so i manually picked the 16 most distinct hues i could

You did great! I could tell the colors were equidistant from how they resembled Penumbra’s schemes. I just have really abnormal vision and have spent several years reading raw hex codes for a project. So I crave more color, heh :D

Re: Your hex editor should color-code bytes

#139

When you're going to color-code bytes in a hex dump, I would expect each ASCII character in the right column to have the same color as the hex byte in the left column, making it easier to pair them. I wonder why that wasn't done here.

i tried it out, but ended up preferring fewer categories. the colors already exist in the main panel and i still find non-graphic ASCII/graphic ASCII/non-ASCII to be useful categories to have

Re: Your hex editor should color-code bytes

#140
post #65

Earlier quoted context omitted.

> It was too random to be encrypted That's a rather odd remark.

It's not? Compare a random data from a pseudo gen, a really random data and some encrypted data. They are all different.

If it's a CSPRNG, and decent encryption, they'll be indistinguishable from random noise.
Post reply on HN