Cryptography and its enhancement with Machine Learning

Gouri Krishna
IETE SF MEC
Published in
6 min readSep 5, 2021
Source: Triskele Labs

Encoding and decoding are prime concepts in the technological world. When we are surrounded by networks interconnected with each other, privacy is just a term whose meaning has been redefined. Security is a concern for all of us and hence, every company boasts about their security policies while availing their services. Whether it be tech giants or simple mobile game makers, they say that our data is safe with them. And we believe them because…Well, let’s just say it gets complicated otherwise.

The term security takes a new level of understanding when we talk about communication. A secure network to exchange messages is essential and no level of security breach can be tolerated in this case. This is the place where cryptography first emerged and it has now grown to wide areas of usage.

Encrypting a message

As we discussed earlier, cryptography was initially used for secure communications. The story of Alice and Bob is used to explain various cryptographic systems in many books. For example, a secret key cryptosystem is a process where Alice and Bob agree on a single secret key and they can only decode each other’s messages using this key. The process of encryption and decryption has been improvised and developed to more complex functionalities that we see today.

Source: Wikipedia

The simple technique of a key fitting into a lock can be called a cryptosystem. Here we are not talking about the traditional key but the smart cards with RFID chips embedded in them. In this system, there are specific codes for the RFID tag and the lock which when matched, opens the door. The problem with this system comes when an attacker is there, watching it all! He /she can identify the secret code in a matter of no time if the card sends the code directly to the lock. So, there has to be some indirect signal sending system.

Source: Dreamstime.com

This is where encryption comes in, to protect our secrete code. There are various protocols and encryptions standards that vary in their level of security. In this article, we will be discussing how Machine Learning can contribute to advancements in cryptography.

Machine learning and Cryptography

Machine learning and cryptanalysis share the same notions or thoughts on some level. A cryptanalyst is a person who analyses a cryptography system to find the right function and break the system. As per our earlier example, we can say that the attacker who tried to find out the RFID secret code sent to the lock so that he/she can enter the room without a key is a cryptanalyst.

If one knows the system of cryptography used in securing a message or a condition, then all the attacker needs to do is decrypt the function from the family of functions that are used in this system. To make it simple, find the right key to open the door from a bunch of keys in the same box.

Source: Wikimedia Commons

This problem of “learning the unknown function” is not as simple as it sounds. One needs to have prior knowledge about the class of possible functions and needs to see the examples of input/output behaviour of the system to decrypt it. In machine learning, the “secret key” in cryptography is referred to as the “target function”, and the “keyspace” in crypto corresponds to a “class of possible target functions”.

What Machine Learning does is provide a technique for the attacker to break a crypto code. So how can we prevent this attacker from decrypting our precious code? Well, let’s bring the enemy to our side, shall we!

ML techniques in Cryptography

It is not new to use ML algorithms in Cryptography but with a huge amount of data being generated every day in the world of crypto, it is a necessity now more than ever to bring ML to its side. Machine Learning automates analytical model structures to continuously learn and adapt to the huge amount of data it is being fed as input. Hence, the ML techniques can be utilized to provide a relationship between the input and output data created by cryptosystems.

Also, various ML techniques can be used to enhance the security of encryptions. Let us look at some ML techniques that can be beneficial in the field of cryptography.

1. Boosting and Mutual Learning

Boosting is an ensemble learning method in Machine Learning that uses a set of algorithms to convert weak learners to strong learners, thus increasing the accuracy of the model. It is done by combining several learners and enhancing the performance of a model. For example, if you want to identify the faces of cats and dogs separately from a collection of cat and dog pictures, each feature like eyes, colour, etc, is a weak learner. You combine them using boosting to provide a strong learning model to give out accurate results in identification.

Source: Edureka

The Mutual Learning technique is another phenomenon in which two neural networks that are trained on their mutual output synchronize to an identical time dependent weight vector. As complicated as it sounds, we can use both boosting and mutual learning techniques to create a private security key over a public channel. This enhances the security of encryption by many folds.

2. Naïve Bayes, Support Vector Machine, and AdaBoost

These three are classification algorithms in machine learning. The Naïve Bayes algorithm is used for classification problems using the Bayes theorem. The Support Vector Machine (SVM) can be used to analyze data for classification and regression. AdaBoost or Adaptive Boosting is a category of Boosting that we discussed earlier.

All three of these techniques can be used to classify the encrypted traffic and objects in steganography [the technique of hiding secret data within an ordinary, non-secret, file or message to avoid detection].

Conclusion

In this article, we have seen a part of what ML can achieve in Cryptography. This is not all. There are several more applications of ML algorithms that can be used in enhancing the security of Cryptographic systems. Also, as we discussed earlier, ML techniques can contribute to better Cryptanalysis as well. Hence, it is important to study and understand further effects of ML techniques in other branches including but not limited to cyber security.

Source: Meme Generator

References:

Some applications of machine learning in cryptography

Where Machine Learning meets Cryptography

Edureka: A Comprehensive Guide To Boosting Machine Learning Algorithms

**We also invite science and technology enthusiasts to write for us. If you think you have interesting stuff which the world should know about, send in your articles to us!***

Interested in writing for us? Fill up this form!

--

--