▲ | orthecreedence a day ago | ||||||||||||||||||||||||||||||||||||||||
I was writing a cryptographically-inclined system with serialization in msgpack. At one point, I upgraded the libraries I was using and all my signatures started breaking because the msgpack library started using a different representation under the hood for some of my data structures. That's when I did some research and found ASN.1 DER and haven't really looked back since switching over to it. If you plan on signing your data structures and don't want to implement your own serialization format, give ASN.1 DER a look. | |||||||||||||||||||||||||||||||||||||||||
▲ | amluto 16 hours ago | parent [-] | ||||||||||||||||||||||||||||||||||||||||
If you are planning to sign your data structures, IMO your first choice should be to sign byte strings: be explicit that the thing that is signed is a specific string of bytes (which cryptographic protocol people love to call octets). Anything interpreting the signed data needs to start with those bytes and interpret them — do NOT assume that, just because you have some data structure that you think serializes to those bytes, then that data structure is authentic. Many, many cryptographic disasters would have been avoided by following the advice above. | |||||||||||||||||||||||||||||||||||||||||
|