don't roll your own crypto

expression

cryptography

The first commandment of applied cryptography: use the vetted algorithms and libraries, never your homemade ones.

Designing crypto that others cannot break is one of the hardest problems in the field, and every homemade cipher looks unbreakable to its author - Schneier's law in action. Rolling your own means your mistakes ship without ever meeting the years of public attack that hardened AES and TLS.

Don't roll your own crypto is the field's most repeated advice, and it means do not implement primitives yourself, not do not learn how they work. The distinction gets lost, and the confusion produces engineers who use cryptography without understanding it, which is its own hazard.

The reason it holds is that cryptographic code fails silently. Ordinary code that is wrong usually misbehaves visibly; a cipher implemented wrongly still produces output that looks random, still decrypts correctly with your own implementation, and passes every test you would think to write. The defects are timing variation, weak randomness, and nonce reuse, none of which are detectable from the output.

The honest scope is narrower than the slogan. Do not implement AES. Do use a well-reviewed library, and understand it well enough to choose the mode, manage the keys and avoid reusing a nonce, because those are your decisions and the library will let you get them wrong. Somebody has to write the libraries, and the people who do are the ones who ignored the advice deliberately and then submitted their work for years of attack. That is the legitimate path, and it starts with study rather than with shipping.

All glossary entries