The need for encryption and tough security measures is at an all-time high, with an increasing number of businesses and consumers falling victim to a whole host of cyber crimes.

Although, the method of encrypting information is certainly not new. In fact, cryptography dates back to ancient times, the only real difference being that now we use electronic devices to generate unique encryption algorithms to scramble our data.

These days you'll find encryption in most things that run using an internet connection, from messaging apps and personal banking apps to websites and online payment methods.

And for consumers, making sure your data cannot be stolen or used for ransom has never been more important.

Read next: What is WannaCry and how does it work?

Techworld looks to explain what encryption is and how it works.

Read next: Best anti-ransomware tools

What is encryption?

In its most basic form, encryption is the process of encoding data, making it unintelligible and scrambled. In a lot of cases, encrypted data is also paired with an encryption key, and only those that possess the key will be able to open it.

An encryption key is a collection of algorithms designed to be totally unique. These are able to scramble and unscramble data, essentially unlocking the information and turning it back to readable data. 

Usually, the person that is encrypting the data will possess the key that locks the data and will make 'copies' and pass them on to relevant people that require access. This process is called public-key cryptography. 

Computer or at least machine cryptography, which encryption is a form of, became significant during the second world war with military forces across Europe tasked with breaking Germany's Enigma code. 

Convoys travelling across the Atlantic were a vital lifeline for Britain as the majority of Europe was occupied by the Nazis.

German U-Boats often used radio signals to send encrypted messages to one another and attack these convoys en masse, planning and undertaking coordinated attacks. It was these messages that were created by the German Navy's Enigma machines, which the British forces set out to decrypt. 

And while it's believed that Polish mathematician Marian Rejewski actually cracked the Enigma code in 1938, not the British, at Bletchley Park in England, Alan Turing and Gordon Weichman created a code-breaking machine called Colossus based on Rejewski's which became the first programmable digital computer.

This marked a huge turning point for encryption and decryption. 

Encryption methods: How does encryption work?

In practice, when you send a message using an encrypted messaging service (WhatsApp for example), the service wraps the message in code, scrambling it and creating an encryption key. It can then only be unlocked by the recipient of the message. 

Digital encryption is extremely complicated and that's why it is considered difficult to crack. To bolster that protection, a new set of encryption algorithms is created each time two smartphones begin communicating with one another. 

You might have heard of end-to-end encryption, perhaps you've received a notification on WhatsApp saying that they now support this type of encryption. 

End-to-end encryption refers to the process of encoding and scrambling some information so only the sender and receiver can see it. 

As previously explained, encryption keys can work as a pair, one locking the information and multiple (which can be passed out) to unlock the encrypted information.

With end-to-end encryption, however, only the sender and recipient are able to unlock and read the information. With WhatsApp, the messages are passed through a server, but it is not able to read the messages.

The diagram above shows how end-to-end encryption works, with one person sending a message to another. 

So that's end-to-end encryption. But what about other methods?

There are two main methods of encryption that can be done: symmetric and asymmetric. While we've touched on these methods briefly already you can gather more detail here. 

Symmetric encryption is the process of using the same key (two keys which are identical) for both encrypting and decrypting data. This will mean two or more parties will have access to the same key, which for some is a big drawback, even though the mathematical algorithm to protect the data is pretty much impossible to crack. People's concerns often land with the behaviours of those with access to the shared key.

Conversely, asymmetric encryption refers to the method of using a pair of keys: one for encrypting the data and the other for decrypting it. 

This process is depicted in the above diagram. The first key is called the public key and the second is called the private key. The public key is shared with the servers so the message can be sent, while the private key, which is owned by the possessor of the public key, is kept a secret, totally private.

Only the person with the private key matching the public one will be able to access the data and decrypt it, making it impenetrable to intruders.

Encryption is used by a lot of organisations and individuals, and while it is there to protect your data, it has come under intense scrutiny from politicians. They argue that security and intelligence services should be able to access people's personal messages in some circumstances, for example, when monitoring suspected terrorists or gaining intelligence on terror attacks that have already happened. 

However, in cases of end-to-end encryption, even the messaging service provider wouldn't be able to intercept the messages, making it difficult to yield to governmental pressure. 

Click here for an in-depth look at this topic

Take our encryption quiz

Find your next job with techworld jobs