Learn cryptographic engineering by example
This is more of a quick tour of the basic API for libsodium than a workshop for learning cryptographic engineering. Many of the exercises have no cryptographic component at all; the remainder basically exercise the most basic libsodium sign&#x2F;verify&#x2F;secretbox functionality. None of the exercises explain the rationale behind any of the libsodium constructions, and (because libsodium) nonce-based authenticated encryption is used without explaining any of the details of what a nonce is and what the requirements are for generating and handling them. Finally, the service model for the crypto involved doesn&#x27;t make a whole lot of sense; most of the exercises build a &quot;tamper proof log&quot; from a simple chained hash function, and ultimately encrypts that log using a key exposed to the server anyways.<p>Respectfully, I don&#x27;t think this is how you should learn cryptography (certainly: you shouldn&#x27;t call this kind of work &quot;cryptographic engineering&quot;).<p>I&#x27;m talking my own book here a little (but just a little, since it&#x27;s not like I make a dime from this) when I say that the better way to learn and understand cryptography is stuff like the Matasano Cryptopals challenges:<p><pre><code>   https:&#x2F;&#x2F;cryptopals.com&#x2F;
</code></pre>
These exercises will try to teach you crypto engineering by <i>breaking</i> cryptography, and without wasting much time structuring a trivial JSON interface. You&#x27;ll understand what a nonce is by the end of set 3 because you&#x27;ll have written exploits for otherwise sane cryptosystems that mishandle nonces. By the end of set 8 you&#x27;ll have implemented invalid curve attacks and built and broken short-tag GCM AEAD encryption and, hopefully, be a little nauseous any time someone asks you to use crypto again --- which is the way it should be.<p>Even after you&#x27;ve undergone our cryptogaphic Ludovico Process, you still won&#x27;t be a &quot;cryptographic engineer&quot;. I&#x27;ve been testing and building exploits for random cryptosystems for over a decade and I&#x27;m nowhere close. The simple, blunt reality of it is that if you&#x27;re going to build anything close to new with cryptography, you really do have to understand the math, and anyone who claims you can get to &quot;securing a banking interface&quot; without a detour through abstract algebra is, I think, doing you a disservice.<p>Another good resource for this stuff is LVH&#x27;s Crypto 101: <a href="https:&#x2F;&#x2F;www.crypto101.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.crypto101.io&#x2F;</a>