Yubico Forum
https://forum.yubico.com/

Notes on endianness
https://forum.yubico.com/viewtopic.php?f=5&t=693
Page 1 of 1

Author:  matthewbloch [ Thu Jul 14, 2011 1:59 am ]
Post subject:  Notes on endianness

While writing some software to parse the tokens, I noticed that http://wiki.yubico.com/wiki/index.php/Yubikey is lacking notes on endianness of the fields, and you would only notice these details after reading the code. Since I can't edit the wiki page myself, I'd like to see these brief notes added:

1) the plaintext public ID, as shipped from the factory, and matching the decimal number written onto the reverse of the key, is presented in big endian order. That is to say, the most significant byte is the first and the least significant byte the last. That's why most tokens start with a line of 'c' characters (zero);

2) the secret ID has no decimal representation or record, so you can treat it as big-endian, little-endian or just six bytes. You can do the same with the public ID too, but by changing it, the key loses its ability to output the number that's been helpfully printed on it.

3) the session counter and the time code are presented in the opposite order, little endian. That is to say the least significant byte comes first.

Page 1 of 1 All times are UTC + 1 hour
Powered by phpBB® Forum Software © phpBB Group
https://www.phpbb.com/