Encrypt

Updated: 09/12/2023 by Computer Hope
Many cubes with 0's and 1's representing binary on them.

Encrypt describes making data unreadable to other humans or computers that should not see the contents. Encrypted data is generated using an encryption program such as PGP (pretty good privacy), encryption machine, or a simple cipher key and appears as garbage until it is decrypted. To read or use the data, it must be decrypted, and only those who have the correct password or decryption key can make the data readable again.

Tip

Unencrypted data is called plaintext; encrypted or scrambled data is called ciphertext.

There are two basic types of encryption in use today. The first type is private-key encryption (symmetric-key encryption), where both people know the secret key to encrypt and decrypt the data. The second type is public-key encryption (asymmetric-key encryption), where the encryption software creates a public and private key. See our public-key cryptography definition for further information about this type of encryption.

Why is encryption needed?

You use encryption daily and are even using it now as you read this page. Encryption helps keep your information and actions private from everyone but the recipient of your information. For example, when you enter your credit card information on a web page, you only want to share that information with one company website. Suppose it was not encrypted; as you transmit that information, it could be intercepted and read by a man-in-the-middle attack. However, when the information is encrypted, if it were intercepted, it would be extremely difficult to read because of encryption. Encryption also helps keep stored information safe. For example, saving your credit card on a website is encrypted to prevent any employee or attacker from reading the information.

Is encryption bad?

No. Encryption is a very good thing, and without encryption, the Internet could not exist as it does today. However, like any technology, encryption can be used by bad people. Some argue that encryption helps protect bad people by preventing authorities from intercepting and reading their communications. However, allowing authorities or governments to bypass encryption to help monitor bad people also breaks encryption for everyone else at the same time. There is no method of only allowing a select few to bypass encryption. Creating a backdoor or other method to bypass encryption breaks the whole concept of secure data. Without that trust in knowing your data is secure, no one would use that encryption method.

But I'm not doing anything bad; why would I care?

A common argument for allowing authorities to bypass encryption is if you're doing nothing bad, you have nothing to hide. While it's great you're doing nothing bad, someone capable of monitoring you without encryption could be doing something bad intentionally or unintentionally. For example, even if you are okay with authorities reading all your private messages, you probably wouldn't want a stalker to have that same ability. When a method for breaking encryption is created, it can be exploited by anyone.

Encryption algorithms

There are many algorithms used to encrypt data. For example, a basic cipher known as simple substitution, substitution cipher, or Caesar cipher (named after Julius Caesar) shifts the alphabet letters over a few characters. Below is an example of the alphabet shifted over four characters.

Encrypt key: a=e, b=f, c=g, d=h, e=i, f=j, g=k, h=l, i=m, j=n, k=o, l=p, m=q, n=r, o=s, p=t, q=u, r=v, s=w, t=x, u=y, v=z, w=a, x=b, y=c, and z=d.

Decrypt key: a=w, b=x, c=y, d=z, e=a, f=b, g=c, h=d, i=e, j=f, k=g, l=h, m=i, n=j, o=k, p=l, q=m, r=n, s=o, t=p, u=q, v=r, w=s, x=t, y=u, and z=v

Using this technique, a user could encrypt the message "computer hope free help for everyone" to "gsqtyxiv lsti jvii lipt jsv izivcsri." Below is an example of how this could be done using the Perl programming language.

my (%key, $new);
my $alpha = "abcdefghijklmnopqrstuvwxyz";
my $message = "computer hope free help for everyone";
@alpha = split(//, $alpha);
my $i=1;
foreach $alpha (@alpha) {
 if ($i >= 23) {
  $i = -3;
 }
 $key{$alpha} = $alpha[$i+3];
 $i++;
}
@message = split(//,$message);
foreach $message (@message) {
if ($message =~/[a-z]/i) {
 $new .= "$key{$message}";
}
else {
 $new .= "$message"; }
}
print "Old: $message\nEncrypted: $new\n";

Conversion tool

A version of the code above is also available online to encrypt and convert text.


Below are other examples of simple encryption algorithms.

  • Transposition encryption - adjacent characters are swapped.
  • Expansion encryption - additional characters are added between the data characters.
  • Compaction encryption - characters in the data are removed and stored elsewhere.

How do I decrypt or remove encryption?

To decrypt encrypted data, you must have the key that tells the computer or encryption program how to decrypt the data. Without the key, the information cannot be read or decrypted.

If encryption could be broken without a key, it would be considered insecure and would no longer be used. A good example of this happening is with WEP (Wired Equivalent Privacy), an encryption method once used with Wi-Fi networks.

How do governments bypass encryption?

Those who study cryptography may decrypt weak ciphers using cryptanalysis, where the encrypted data is studied, and ther are various methods to decrypt the data. However, weak methods like these are avoided because they are known to be insecure.

To break stronger encryption, you need access to a supercomputer capable of performing brute force attacks or using various algorithms to break the encryption. However, the strongest encryption still cannot be cracked, even with the fastest supercomputer spending over a hundred years attempting to break one message.

Because of this difficulty, most strong encryption is broken after a government subpoenas a company to assist in breaking or bypassing the encryption. Some governments may also request backdoor access through an encryption algorithm. However, all experts agree that once a backdoor is created, the encryption algorithm is no longer considered safe to use because it can be circumvented.

Can encrypted data be deleted?

Encrypted data is not protected data; it can be deleted, edited, overwritten, and infected. Encrypted data could even be encrypted again using another encryption algorithm. If you have encrypted data you cannot access and want to recover the space it occupies, it can be deleted like all other files and doesn't require a key. If you have a full hard drive or operating system protected by encryption, it can also be formatted.

Note

Deleting encrypted data or formatting an encrypted drive does not recover the data that was encrypted; it removes the encryption and the data. In other words, all encrypted data is lost.

Note

If the encrypted data was caused by ransomware, deleting the encrypted files does not remove the ransomware. However, formatting the hard drive to erase everything and start over would remove the ransomware. Additionally, removing ransomware from a computer does not decrypt the data. The password or decryption key is still required to decrypt the data.

AES, Certificate authority, Cleartext, Cryptanalysis, Cryptography, Decryption, DES, Differential cryptanalysis, Digital signature, IDEA, Key, MDC, Node encryption, PGP, Public-key cryptography, Rijndael encryption, Security terms, SSL, Truecrypt