[Cryptography] Is ASN.1 still the thing?

Ron Garret ron at flownet.com
Mon Nov 13 21:11:45 EST 2017


On Nov 13, 2017, at 6:20 AM, David Wong <davidwong.crypto at gmail.com> wrote:

> If you want something fast (binary), but don't want the awfulness of
> ASN.1 I believe google's protobuf is the state of the art solution. Or
> better, you can have a fixed structure (with fixed sized fields) and I
> believe this is what Wireguard does.

I got fed up with the complexity of ASN.1 and DER and designed my own binary serialization format for my implementation of the Signal double-ratchet.  The only documentation is in the in-line comments of the original implementation, which was done in Common Lisp:

https://github.com/rongarret/tweetnacl/blob/master/ratchet.lisp

Docs start at line 82.  The Javascript version is at:

https://github.com/rongarret/ratchet-js

The format is not quite unambiguous.  Binary fields whose length is a power of 2 can be encoded in two different ways.  But that is the only ambiguity, and it could easily be fixed if needed.

Feedback would be very much appreciated.

rg



More information about the cryptography mailing list