Show HN: Monocypher: a small, easy to use crypto library
Saved you a click: it&#x27;s many of the same ideas as libsodium, but mostly with ChaCha and allegedly easier to deploy. I&#x27;m not sure I believe the latter, and my recommendation to use libsodium stands. ChaCha20 is also available (but only in AEAD mode with Poly1305) in libsodium, if you really need it. I think XSalsa20 is a reasonable default: if you had a protocol where there&#x27;s an obvious sequence number to use as a nonce, you probably should already be using TLS anyway; most of the things where libsodium is your best option is precisely in the cases where you don&#x27;t have the luxury of solving that sort of coordination problem, and you want a random nonce (and hence, extended-nonce versions like XSalsa20 or XChaCha20. I don&#x27;t know of anyone who has deployed XChaCha20, although the construction is &quot;obvious&quot;.)<p>I&#x27;ve previously criticized a blog by the same author called Rolling Your Own Crypto, which had serious flaws.<p>AFAICT, this is ostensibly cryptographically fine (modulo some safeguards that probably only matter if you&#x27;re Doing It Wrong already anyway), even though the final recommendation is still &quot;avoid&quot;. There are many things I disagree with (don&#x27;t put the documentation for the internal hash for ChaCha20 before the authenticated encryption API!), and using TweetNaCl as a base is less interesting than using libsodium which is both fast and has a lot more eyeballs on it.