Start Crypto with Python

Start your Cryptography journey here with Python

Want to learn and master modern cryptography?

Did you know that the biggest learnings and most important principles in cryptography come from the old systems? The systems that are easy to understand?

That often surprises people. The things that are the easiest to understand gives the best understanding of why modern cryptography evolved into what it is today.

This page will guide your through some tutorials, where you learn cryptography with Python examples.

Learning principles

The best way to learn is to try it yourself.

You will not learn how to ride a bike by watching others do it. You need to get on the bike and try it yourself.

The same is true for cryptography. To really understand it you will need to program the examples.

Hence, the approach here is to make programs in Python to explain the theory, weaknesses and learn along the way.

I find it fun to program all these examples and understand it that way. That is the most important principle in learning. Keep it playful and fun.

Let’s get started.

Step 1: Caesar Cipher – the birth of cryptography

What makes Caesar Cipher both brilliant, weak, and gives us the biggest learning about modern cryptography?

You might not have noticed that. Many people have tried to play around with Caesar Cipher, but never thought about that.

In the first tutorial we will cover what it is and how it works.

Step 2: How Caesar Cipher teaches us the most important principle in modern cryptography

This is important. This is counter intuitive. And what is more crazy, it is not followed in modern security. Why?

Well, the lesson is about to be fully appreciated – but it is unbelievable how long it has taken.

What am I talking about. Read and follow the tutorial.

Step 3: Substitution Cipher – the next natural step

Increase the key size. Make it big.

If you cannot brute force the key space the cipher must be secure. Isn’t that what we learned from previous step?

Correct. But there is more to it.

Read and follow the next tutorial.

Step 4: One Time Pad – the most secure cipher

The ideal cipher. The most secure cipher. So what is the problem?

One Time Pad has it all. It is information theoretical secure? So what is the catch? Why are we not done with cryptography and security in the modern world?

Well, it takes some explanation and understanding.

Read and follow the tutorial.

Step 5: Asymmetric Encryption

The One Time Pad gives rise to the problem of the key size and key exchange. Well, the key size for One Time Pads is too big.

Another challenge with One Time Pad is that sender and receiver need the same key. That is a symmetric encryption scheme.

What if we could have a asymmetric encryption scheme, where you use different keys to encrypt and decrypt. How would that help you?

Learn about it here.

Step 6: How to solve the asymmetric encryption problem

Now you understand the idea behind asymmetric encryption.

How to solve it?

Check out RSA.

Step 7: Key exchange problem

Another approach could be to have an algorithm to create a symmetric key between two parties that have never met. Of course, in a way that only the two participating parties know the key. No one else.

Why does that matter?

Step 8: How to solve the key exchange problem

That is amazing. Can you really create a system, which can do that for you?

Yes, and it isn’t that complex.

Check it out how Diffie-Hellman solved that problem.

Step 9: Have fun cracking your password!

Now time for some fun stuff.

How does your computer verify your password? Or any password you use. Say, if your password lies on a server, then it would be freely available to anyone with access to that part of the server.

That would not be secure.

What is used is a salted hash-value of your password. In that way, nobody except you knows the password.


Check out the tutorial on that.

Next steps…

Well, this will get you started.

I would highly encourage you to do more programming of these examples and fill out some of the gabs.

Luckily I have created an online course covering all that.

It is a best selling course on Udemy.