Thursday, June 9, 2016

How do I correctly use libsodium so that it is compatible between versions?

Leave a Comment

I'm planning on storing a bunch of records in a file, where each record is then signed with libsodium. However, I would like future versions of my program to be able to check signatures the current version has made, and ideally vice-versa.

For the current version of Sodium, signatures are made using the Ed25519 algorithm. I imagine that the default primitive can change in new versions of Sodium (otherwise libsodium wouldn't expose a way to choose a particular one, I think).

Should I...

  1. Always use the default primitive (i.e. crypto_sign)
  2. Use a specific primitive (i.e. crypto_sign_ed25519)
  3. Do (1), but store the value of sodium_library_version_major() in the file (either in a dedicated 'sodium version' field or a general 'file format revision' field) and quit if the currently running version is lower
  4. Do (3), but also store crypto_sign_primitive()
  5. Do (4), but also store crypto_sign_bytes() and friends

...or should I do something else entirely?

My program will be written in C.

0 Answers

If You Enjoyed This, Take 5 Seconds To Share It

0 comments:

Post a Comment