Is Open-Source Cryptography Really Secure?
Tags: cryptography, programming, security, opensource
Published: 2020-01-30 14:14:12

---
title: Is Open-Source Cryptography Really Secure?
published: true
date: 2020-01-30 14:13:02 UTC
tags: cryptography,programming,security,open-source
canonical_url: https://qvault.io/2020/01/30/is-open-source-cryptography-really-secure/?utm_source=rss&utm_medium=rss&utm_campaign=is-open-source-cryptography-really-secure
---

By Lane Wagner – [@wagslane](https://twitter.com/wagslane) on Twitter

![](https://qvault.io/wp-content/uploads/2020/01/photo-1497285597995-6ed7de6bfebd-1024x716.jpg)

The purpose of cryptography is to keep information private, and the purpose of open-source is to make code public…

## …Danger!

Just kidding.

I’ve been asked this several times by multiple people so I figured it is a subject worth addressing. Many developers seem to be under the impression that crypto and security systems (the application-specific implementation of cryptosystems) are more secure if their details are kept private.

**This can’t be further from the truth**

According to [Kerckhoffs’s principle](https://en.wikipedia.org/wiki/Kerckhoffs%27s_principle), also known as Shannon’s maxim:

* * *

_The enemy knows the system. One ought to design systems under the assumption that the enemy will immediately gain full familiarity with them. #security #opensource #privacy_  
[Click To Tweet](https://twitter.com/intent/tweet?url=https%3A%2F%2Fwp.me%2Fpb7Qei-bP&text=The%20enemy%20knows%20the%20system.%20One%20ought%20to%20design%20systems%20under%20the%20assumption%20that%20the%20enemy%20will%20immediately%20gain%20full%20familiarity%20with%20them.%20%23security%20%23opensource%20%23privacy&via=wagslane&related=wagslane)

* * *

There are several reasons as to why this is a good rule to live by, let’s examine each one.

## 1. Obfuscation Isn’t Encryption

If a developer is operating under the assumption that attackers won’t know about the details of their code, they may be tempted to try to build in security that is dependent on that.

For example, they may [encode data in a confusing way instead of encrypting it](https://qvault.io/2019/08/14/stop-with-the-obfuscation-encoding-and-encryption-are-not-the-same/), assuming that the enemy will think it is encrypted, or not be able to guess HOW it was encoded.

**BAD.**

When something needs to be kept secret, always encrypt.

![](https://qvault.io/wp-content/uploads/2019/08/code_talkers.png)

## 2. You Probably Suck

If you roll your own crypto, you are likely to overlook vulnerabilities that have been accounted for in open-source versions. By the way, **I don’t mean that you specifically suck at writing crypto** , I mean that no one person (or organization) can reasonably be responsible for vetting all possible attack vectors. Open-source allows the worldwide developer community to help expose problems with the code.

![](https://qvault.io/wp-content/uploads/2020/01/loser.png)

Not only are you likely to have problems in underlying mathematics and algorithms, but it is likely that your application-level implementation will also have vulnerabilities. There are no industry standard best practices to follow for your custom algorithms.

## 3. Get New Updates

By using popular crypto libraries that are regularly updated, your code won’t be vulnerable to the recently discovered attacks on the algorithms you are using.

Take advantage of the community, and give back by contributing when you can!

Golang: [https://golang.org/pkg/crypto/](https://golang.org/pkg/crypto/)

Node: [https://nodejs.org/api/crypto.html](https://nodejs.org/api/crypto.html)

Python: [https://pypi.org/project/cryptography/](https://pypi.org/project/cryptography/)

## Thanks For Reading

Lane on Twitter: [@wagslane](https://twitter.com/wagslane)

Lane on Dev.to: [wagslane](https://dev.to/wagslane)

Download Qvault: [https://qvault.io](https://qvault.io/)

The post [Is Open-Source Cryptography Really Secure?](https://qvault.io/2020/01/30/is-open-source-cryptography-really-secure/) appeared first on [Qvault](https://qvault.io).