# Encryption 101: Keys, Algorithms and You

Contents

- 1 Encryption 101: Keys, Algorithms and You
- 1.1 Caesar’s cypher is the simplest encryption algorithm. It adds a fixed value to the ASCII (unicode) value of each character of a text. In other words, it shifts the characters. Decrypting a text is simply shifting it back by the same amount, that is,
- 1.1.0.1 Direct link to this comment
- 1.1.0.2 Direct link to this comment
- 1.1.0.3 Direct link to this comment
- 1.1.0.4 Direct link to this comment
- 1.1.0.5 Direct link to this answer
- 1.1.0.6 Direct link to this answer
- 1.1.0.7 Direct link to this answer
- 1.1.0.8 Direct link to this answer
- 1.1.0.9 Direct link to this comment
- 1.1.0.10 Direct link to this comment
- 1.1.0.11 Direct link to this answer
- 1.1.0.12 Direct link to this answer
- 1.1.0.13 Direct link to this answer
- 1.1.0.14 Direct link to this answer

- 1.2 Encryption 101: Keys, Algorithms and You
- 1.3 Encryption and Decryption
- 1.4 5 Common Encryption Algorithms and the Unbreakables of the Future
- 1.5 How Encryption Works
- 1.6 Encryption in Action
- 1.7 Common Encryption Algorithms
- 1.8 NIST and the Future of Encryption
- 1.9 Go Beyond Encryption

- 1.1 Caesar’s cypher is the simplest encryption algorithm. It adds a fixed value to the ASCII (unicode) value of each character of a text. In other words, it shifts the characters. Decrypting a text is simply shifting it back by the same amount, that is,

Triple DES was designed to replace the original Data Encryption Standard (DES) algorithm, which hackers eventually learned to defeat with relative ease. At one time, Triple DES was the industry’s recommended standard and the most widely used symmetric algorithm.

## Caesar’s cypher is the simplest encryption algorithm. It adds a fixed value to the ASCII (unicode) value of each character of a text. In other words, it shifts the characters. Decrypting a text is simply shifting it back by the same amount, that is,

Suppose b is negative enough that a+b would be less than zero. Because of the char() that would be char() of a negative value and because char cannot be negative that would be changed to 0.

You need to do your work in signed integer or in floating-point and convert to char afterwards

##### 2 Comments

muhammad usman on 13 Apr 2020

#### Direct link to this comment

Cancel Copy to Clipboard

#### Direct link to this comment

Cancel Copy to Clipboard

i have modified function and included your sugestion. but still not working

function coded = caesar(a,b)

while b>126 % b must be 126 or less so that only 1 cycle for each number

c = length(code);

for ii = 1:c

if code(ii) > 126;

d = code(ii) – 126;

code(ii) = (31+d);

elseif code(ii)<32;
d = code(ii) - 32;
code(ii) = (127+d);
coded = char(code);
Walter Roberson on 13 Apr 2020

#### Direct link to this comment

Cancel Copy to Clipboard

#### Direct link to this comment

Cancel Copy to Clipboard

if b were 256 then that should probably be the same outcome as if it were 0, but you treat it as 126. You also do not raise negatives into the positive range at that stage.

David Hill on 13 Apr 2020

#### Direct link to this answer

Cancel Copy to Clipboard

#### Direct link to this answer

Cancel Copy to Clipboard

Are you using the full range from 0-255 for ascii? or do you want the output to have only letters (a-zA-Z) and no special characters?

function coded = caesar(a,b)

coded=char(mod(unicode2native(a)+b,256));

##### 0 Comments

KaMATLAB on 2 Sep 2020

#### Direct link to this answer

Cancel Copy to Clipboard

#### Direct link to this answer

Cancel Copy to Clipboard

function txt = caesar(txt,key)

txt = double(txt) + key;

first = double( ‘ ‘ );

last = double( ‘~’ );

% use mod to shift the characters – notice the + 1

% this is a common error and results in shifts

% being off by 1

txt = char(mod(txt – first,last – first + 1) + first);

##### 1 Comment

KaMATLAB on 2 Sep 2020

#### Direct link to this comment

Cancel Copy to Clipboard

#### Direct link to this comment

Cancel Copy to Clipboard

This is the solution to the question.

Prerona Dey on 21 Nov 2020

#### Direct link to this answer

Cancel Copy to Clipboard

#### Direct link to this answer

Cancel Copy to Clipboard

function y = caesar2(ch, key)

[~, loc] = ismember(ch, v);

v2 = circshift(v, -key);

Can u please explain me this soultion I found.

##### 0 Comments

Zia Ur Rehman on 28 Aug 2022

#### Direct link to this answer

Cancel Copy to Clipboard

#### Direct link to this answer

Cancel Copy to Clipboard

I write this code, this is working fine with the problem.

Need further improvement if any from seniors as I’m very novice in coding and MATLAB.

function coded = caesar(a,b)

% removing the ‘;’ so you can see how it works in output

c = double(a) % to convert the given char(string) into double(numeric)

d=c+b % adding the shift smount to encrypt

l= length(d) % measuring the length as we need to traverse every element to check if it lies in the limit(32:126)

for e = 1:l % applying loop to check each element if it lies in the limit

while d(e) > 126 % using while as if we use ‘if’ statement it will only execute once but we need execution untill the value comes in the limit

d(e) = d(e)-95 % if number is greater than 126 so wrap around by adding (126-32+1=95) we use +1 as we need next number not the same number

while d(e) < 32 % using while as if we use if statement it will only execute once but we need execution untill the value comes in the limit

d(e) = d(e) + 95 % if number is less than 32 so wrap around by subtracting (126-32+1=95) we use +1 as we need next number not the same number

## Encryption 101: Keys, Algorithms and You

In today’s world, understanding at a minimum basic level how to protect data you’re both storing and transmitting is essential to your business’ survival. information technology professional Mike Chapple shows how to protect confidential information via encryption, and teaches the basics when it comes to selecting an encryption technology.

### Like this article? We recommend

### Like this article? We recommend

### Like this article? We recommend

*Encryption* provides the ability to use mathematical algorithms to protect the confidentiality and integrity of information transmitted via insecure means or stored in an insecure location. While the detailed mathematics underlying encryption may be intimidating, the basic concepts are quite accessible, and all technology professionals should have at least a basic understanding of how encryption provides these security benefits.

In this article, we take a look at how you can use encryption algorithms to protect confidential information and prove to a recipient or third party that you are the undeniable sender of a message. You’ll also learn the basic principles that should guide the selection of an encryption technology.

## Encryption and Decryption

Encryption takes cleartext data and uses a mathematical algorithm, in conjunction with an encryption key, to convert it into a form that is only readable by someone who knows the algorithm that was used and has access to the proper decryption key. This encrypted data is often referred to as the *ciphertext*. The encryption algorithm may be from one of two classes: symmetric algorithms and asymmetric algorithms.

### Symmetric Encryption

In a *symmetric encryption algorithm*, both the sender and the recipient use the same key (known as the *secret key*) to encrypt and decrypt the message. One very basic symmetric encryption algorithm is known as the *rotational cipher*. In this algorithm, the sender simply “adds” the key to each character of the cleartext message to form the ciphertext. For example, if the key is 2, “A” would become “C”, “B” would become “D”, and so on. The recipient would then decrypt the message by “subtracting” the key from each character of the ciphertext to obtain the original message.

Let’s work through a brief example where we take the word “APPLE” and encrypt it with a key of 4 using this simple algorithm:

Cleartext: A P P L E Key: 4 4 4 4 4 Ciphertext: E T T P I

Of course, modern symmetric encryption algorithms are far more complex, making use of sophisticated combinations of substitution (changing one letter for another) and transposition (rearranging the letters of a message). You may be familiar with some of these algorithms. The Data Encryption Standard (DES), Advanced Encryption Standard (AES), Blowfish, and Twofish are all examples of symmetric algorithms.

### Asymmetric Encryption

In an *asymmetric encryption algorithm*, the sender and recipient use different keys to encrypt and decrypt a message. Each participant in the cryptosystem has a pair of keys assigned to him: a public key and a private key. The *public key*, as the name implies, is treated as public information and shared with all users of the encryption system. The *private key*, on the other hand, is a closely guarded secret that should be known only to its owner. Messages encrypted with one key from a public/private pair may only be decrypted with the other key from that pair.

When encrypting a message with an asymmetric algorithm, the sender encrypts the message with the recipient’s public key (which, again, is known to everyone). This creates a message that only the intended recipient can decrypt, because he or she is the only person with access to the corresponding private key necessary to decrypt the message. Even the sender can not decrypt the message that he or she created once it is encrypted with the public key belonging to another user.

Examples of modern asymmetric encryption algorithms include Pretty Good Privacy (PGP) and the Rivest Shamir Adelman (RSA) algorithm.

Page 1 of 3 Next >

## 5 Common Encryption Algorithms and the Unbreakables of the Future

With increasingly frequent and sophisticated cyber threats and data breaches, cybersecurity is crucial to every organization’s data protection efforts today. TechTarget says data encryption is “a foundational element of cybersecurity.”

However, a 2023 study by Thales Group found that **only** **20 percent** **of respondents reported that 60 percent or more of their cloud data is encrypted**. The same study found that, on average, **only 45 percent of sensitive data is encrypted**. Overall, the report spotlights that significant amounts of sensitive data are unencrypted.

That is changing, and the numbers bear this out. Market Research Future projects that the data encryption market will grow from $13.4 billion in 2022 to $38.5 billion by 2023, a robust 16.3 percent CAGR.

With that in mind, let’s dive into the various encryption technologies and what the future holds. That includes growing threats from quantum computers—and what the National Institute of Standards and Technology (NIST) is doing about it today.

## How Encryption Works

Encryption is a way for data—messages or files—to be made unreadable, ensuring that only an authorized person can access that data. **Encryption uses complex algorithms to scramble data and decrypt the same data using a key provided by the message sender.** Encryption ensures that information stays private and confidential, whether it’s being stored or in transit. Any unauthorized access to the data will only see a chaotic array of bytes.

Here are some essential encryption terms you should know:

#### Algorithm

Also known as a cipher, **algorithms are the rules or instructions for the encryption process**. The key length, functionality, and features of the encryption system in use determine the effectiveness of the encryption.

#### Decryption

**Decryption is the process of converting unreadable ciphertext to readable information**.

#### Key

An **encryption key is a randomized string of bits used to encrypt and decrypt data**. Each key is unique, and longer keys are harder to break. Typical key lengths are 128 and 256 bits for private keys and 2048 for public keys.

There are two kinds of cryptographic key systems, symmetric and asymmetric.

### Symmetric Key Systems

Everyone accessing the data in a symmetric key system has the same key. Keys that encrypt and decrypt messages must also remain secret to ensure privacy. While it’s possible for this to work, securely distributing the keys to ensure proper controls are in place makes symmetric encryption impractical for widespread commercial use.

### Asymmetric Key Systems

An asymmetric key system, also known as a public/private key system, uses two keys. One key remains secret—the private key—while the other key is made widely available to anyone who needs it. This key is called the public key. The private and public keys are mathematically tied together, so the corresponding private key can only decrypt that information encrypted using the public key.

## Encryption in Action

Here’s an example of how encryption works with email-friendly software Pretty Good Privacy (PGP) or GnuPG—also known as GPG—for open-source aficionados. Say I want to send you a private message. I encrypt it using one of the programs listed below.

Here’s the message:

Once encrypted, the message becomes a jumbled mess of random characters. But, equipped with the key I send you, you can decrypt it and find the original message:

“Come on over for hot dogs and soda!”

**Whether it’s in transit like our hot dog party email or resting on your hard drive, encryption keeps prying eyes out of your business**—even if they gain access to your network or system.

The technology comes in many forms, with key size and strength generally being the most significant differences from one variety to the next.

## Common Encryption Algorithms

### 1. Triple DES

Triple DES was designed to replace the original Data Encryption Standard (DES) algorithm, which hackers eventually learned to defeat with relative ease. At one time, Triple DES was the industry’s recommended standard and the most widely used symmetric algorithm.

**Triple DES uses three individual keys with 56 bits each**. The total key length adds up to 168 bits, but experts argue that 112 bits in key strength is more accurate. Despite slowly being phased out, Triple DES has mostly been replaced by the Advanced Encryption Standard (AES).

### 2. AES

**The** **Advanced Encryption Standard (AES****) is the algorithm trusted as the standard by the U.S. Government** and numerous organizations and is also found in Arcserve Unified Data Protection (UDP) software. Although it is highly efficient in 128-bit form, AES also uses keys of 192 and 256 bits for heavy-duty encryption purposes.

AES is largely considered impervious to all attacks, except for brute force, which attempts to decipher messages using all possible combinations in the 128, 192, or 256-bit cipher.

### 3. RSA Security

**RSA** **is a public-key encryption algorithm and the standard for encrypting data sent over the internet**. It is also one of the methods used in PGP and GPG programs. Unlike Triple DES, RSA is considered an asymmetric algorithm because it uses a pair of keys. You have your public key to encrypt the message and a private key to decrypt it. RSA encryption results in a huge batch of mumbo jumbo that takes attackers a lot of time and processing power to break.

### 4. Blowfish

Blowfish is yet another algorithm designed to replace DES. This symmetric cipher splits messages into blocks of 64 bits and encrypts them individually. **Blowfish is known for its tremendous speed and overall effectiveness**. Meanwhile, vendors have taken full advantage of its free availability in the public domain. You’ll find Blowfish in software categories ranging from ecommerce platforms for securing payments to password management tools, where it protects passwords. It’s one of the more flexible encryption methods available.

### 5. Twofish

Computer security expert Bruce Schneier is the mastermind behind Blowfish and its successor Twofish. Keys used in this algorithm may be up to 256 bits in length, and as a symmetric technique, you only need one key. **Twofish is one of the fastest of its kind and ideal for use in hardware and software environments**. Like Blowfish, Twofish is freely available to anyone who wants to use it.

## NIST and the Future of Encryption

Cyberattacks constantly evolve, forcing security specialists to concoct new schemes and methods to keep them at bay. To fight back, **the NIST has just** **announced** **four new standardized encryption algorithms**, with three expected to be ready in 2024 and others to follow.

Started in 2016 as the NIST’s Post-Quantum Cryptography Standardization project, these algorithms have been winnowed down from 69 submissions by cryptography experts in dozens of countries. Those algorithms that made the cut were then released for experts to analyze and crack if they could. Following multiple rounds of open and transparent evaluation, four were selected:

– CRYSTALS-Kyber (FIPS 203), designed for general encryption purposes, such as creating websites

– CRYSTALS-Dilithium (FIPS 204), designed to protect the digital signatures used when signing documents remotely

– SPHINCS+ (FIPS 205) is also designed for digital sinatures

– FALCON is also designed for digital signatures and is slated to receive its own draft FIPS in 2024.

## Go Beyond Encryption

Whether it’s protecting your data in transit or at rest, you should be certain that you include encryption in your lineup of security tools. But **there’s much more to data protection, from deep-learning cybersecurity to immutable backups that can’t be altered or deleted** by unauthorized users.

For expert help with all your data protection, business continuity, backup, and disaster recovery requirements, **choose an** **Arcserve technology partner****.** Check out our free trials to see how easy to use and effective Arcserve solutions can be.