Table of Contents

Companies in every sector must comply with standards and regulations, and one of the best ways to do this is to utilize encryption. Encryption takes data that can be clearly read, also known as plaintext, and runs it through an encryption algorithm. An encryption algorithm uses a key and mathematics to convert the plaintext into ciphertext, which is an undecipherable collection of letters and symbols. The process of encryption can be reversed using the same key, or the other key in a key pair, in a process called decryption. There are two different types of encryption: asymmetric and symmetric encryption.

Asymmetric vs Symmetric Encryption

Symmetric encryption involves the use of one key for both encryption and decryption. The plaintext is read into an encryption algorithm along with a key. The key works with the algorithm to turn the plaintext into ciphertext, thus encrypting the original sensitive data. This works well for data that is being stored and needs to be decrypted at a later date. The use of just one key for both encryption and decryption reveals an issue, as the compromise of the key would lead to a compromise of any data the key has encrypted. This also does not work for data-in-motion, which is where asymmetric encryption comes in.

Asymmetric encryption works with a pair of keys. The beginning of asymmetric encryption involves the creation of a pair of keys, one of which is a public key, and the other which is a private key. The public key is accessible by anyone, while the private key must be kept a secret from everyone but the creator of the key. This is because encryption occurs with the public key, while decryption occurs with the private key. The recipient of the sensitive data will provide the sender with their public key, which will be used to encrypt the data. This ensures that only the recipient can decrypt the data, with their own private key.

Uses for Asymmetric and Symmetric Encryption

Asymmetric and symmetric encryption are each better used for different situations. Symmetric encryption, with its use of a single key, is better used for data-at-rest. Data stored in databases needs to be encrypted to ensure it is not compromised or stolen. This data does not require two keys, just the one provided by symmetric encryption, as it only needs to be safe until it needs to be accessed in the future. Asymmetric encryption, on the other hand, should be used on data sent in emails to other people. If only symmetric encryption were used on data in emails, the attacker could take the key used for encryption and decryption and steal or compromise the data. With asymmetric encryption, the sender and recipient ensure only the recipient of the data can decrypt the data, because their public key was used to encrypt the data. Both types of encryption are used with other processes, like digital signing or compression, to provide even more security to the data.

Common Asymmetric and Symmetric Encryption Algorithms

Symmetric Encryption Algorithms:

Asymmetric Encryption Algorithms:

Comparison Table

 Asymmetric EncryptionSymmetric Encryption
DefinitionA two-way function that takes in plaintext data, and turns it into undecipherable ciphertext. This process utilizes a public key for encryption and a private key for decryption.A two-way function that takes in plaintext data, and turns it into undecipherable ciphertext. This process uses the same key for both encryption and decryption.
Use Cases
  • Digital Signing: Asymmetric encryption is much better for digital signing, compared to symmetric encryption. The use of both a public and private key means the identity of the signer of the data can easily be known. The signer uses their private key for encryption, while the recipient verifies their identity with their public key. As only the public key of the signer can decrypt data encrypted with the signer’s private key, the identity of the signer is verified when the data is decrypted.
  • Blockchain: Again, the identification of the user during cryptocurrency transactions is much easier done with asymmetric encryption.
  • Public Key Infrastructure (PKI): The identity of key owners is proven with certificates in PKI, and thus asymmetric encryption is the better choice in PKIs.
  • Banking: Encrypting sensitive customer data in banks is extremely important, as is decrypting that information as quickly as possible. For this reason, symmetric encryption is the preferred method of encryption in banks, as one key encryption is much swifter than two key encryption.
  • Data Storage: As with banking, data storage services and products tend to use symmetric encryption. This method is much swifter to encrypt and decrypt data needed in a timely manner.
Advantages
  • The loss of the public key does not result in the compromise of data
  • More secure than symmetric encryption
  • Only the owner of the private key can decrypt the data sent to them
  • Simpler to implement
  • Faster than asymmetric encryption
  • Protects data from compromise
Disadvantages
  • Slower than symmetric encryption
  • More complicated to implement than symmetric encryption
  • Loss of a key means any data encrypted with that key can be compromised
  • Less secure than asymmetric encryption
Common AlgorithmsECDSA, RSA, PGPAES, Blowfish, Twofish, RC4

Free Downloads

Datasheet of Encryption Consulting Services

Encryption Consulting is a customer focused cybersecurity firm that provides a multitude of services in all aspects of encryption for our clients.

Download
Encryption Services

About the Author

President at Encryption Consulting LLC focusing on providing consulting to customers in the Applied Cryptography space.

Table of Contents

In the data security field, encryptioand hashing are commonly compared, but why is this the case. Encryption is a two-way function where data is passed in as plaintext and comes out as ciphertext, which is unreadable. Since encryption is two-way, the data can be decrypted so it is readable again. Hashing, on the other hand, is one-way, meaning the plaintext is scrambled into a unique digest, through the use of a salt, that cannot be decrypted. Technically, hashing can be reversed, but the computational power needed to decrypt it makes decryption infeasible.

The way hashing works is with a hashing algorithm. This algorithm is most effective when it collision resistant. Collision resistance means that all the digests are unique and do not overlap with each other. This means that the hashing algorithm must be complex enough to not have overlapping hashes, but not so complex as to take too long to compute hashes. Encryption comes in two different types, and both encryption and hashing have several common types of algorithms.

Common Encryption and Hashing Algorithms

Encryption comes in two types: Asymmetric and Symmetric. Asymmetric encryption uses two different keys, a public and private key, for encryption and decryption. The private key is used to encrypt data, and is kept a secret from everyone but the person encrypting the data. The public key is available for anyone, and is used for decryption. Using asymmetric encryption, the authenticity of the data can be verified, because if the data was modified in transit, it would not be able to be re-encrypted with the private key. Symmetric encryption uses the same key for both encryption and decryption. This type of encryption uses less processing power and is faster, but is less secure as only one key is used.

Symmetric Encryption Algorithms:

Asymmetric Encryption Algorithms:

Hashing Algorithms:

  • Message Digest Algorithm (MD5)
  • Secure Hashing Algorithm (SHA-1, SHA-2, SHA-3)
  • WHIRLPOOL
  • TIGER
  • Cyclical Reduction Check (CRC32)
Is your data secure through all of the phases of data lifecycle?

Hashing and Encryption Use Cases

Though they are similar, encryption and hashing are utilized for different purposes. One of the uses for hashing is to compare large amounts of data. Hash values are much easier to compare than large chunks of data, as they are more concise. Hashing is also used for mapping data, as finding values using hashes is quick, and good hashes do not overlap. Hashes are used in digital signatures and to create random strings to avoid duplication of data in databases too. As hashing is extremely infeasible to reverse, hashing algorithms are used on passwords. This makes the password shorter and undiscoverable by attackers.

Encryption, on the other hand, tends to be used for encrypting data that is in transit. Data being transmitted is data that needs to be read by the recipient only, thus it must be sent so that an attacker cannot read it. Encryption hides the data from anyone taking it in the middle of transit, and allows only the decryption key owner to read the data. Other times encryption would be used over hashing is for storing and retrieving data in databases, authentication methods, and other cases where data must be hidden at rest, but retrieved later.

 EncryptionHashing
DefinitionA two-way function that takes in plaintext data, and turns it into undecipherable ciphertext.A one-way method of hiding sensitive data. Using a hashing algorithm, hashing turns a plaintext into a unique hash digest that cannot be reverted to the original plaintext, without considerable effort.
Reversible or Irreversible?ReversibleIrreversible
Variable or Fixed Length Output?Variable LengthFixed Length
TypesAsymmetric and SymmetricHashing
Common AlgorithmsAES, RC4, DES, RSA, ECDSASHA-1, SHA-2, MD5, CRC32, WHIRLPOOL

Free Downloads

Datasheet of Encryption Consulting Services

Encryption Consulting is a customer focused cybersecurity firm that provides a multitude of services in all aspects of encryption for our clients.

Download
Encryption Services

About the Author

President at Encryption Consulting LLC focusing on providing consulting to customers in the Applied Cryptography space.

Table of Contents

Twofish is the successor to Blowfish, and, like its predecessor, uses symmetric encryption, so only one 256-bit key is necessary. This technique is one of the fastest encryption algorithms and is ideal for both hardware and software environments. When it was released, it was a finalist for the National Institute of Technology and Science’s (NIST’s) competition to find a replacement for the Data Encryption Standard (DES) encryption algorithm. In the end, the Rjindael algorithm was selected over the Twofish encryption algorithm. Similar to Blowfish, a block cipher is used in this symmetric encryption algorithm.

Symmetric encryption is a process that uses a single key to both
encrypt and decrypt information. The key is taken in, along with the plaintext information, by the encryption algorithm. This key encrypts the data into ciphertext, which cannot be understood unless it is decrypted. When the encrypted data is sent to the recipient of the data, the symmetric encryption key must also be sent, either with or after the ciphertext has been sent. This key can then be used to decrypt the data.

Is Twofish secure?

A question many organizations ask is: Is Twofish safe, if the NIST did not want to use it to replace DES? The answer is yes, Twofish is extremely safe to use. The reason the NIST did not wish to utilize Twofish is due to it being slower, compared to the Rjindael encryption algorithm. One of the reasons that Twofish is so secure is that it uses a 128-bit key, which is almost impervious to brute force attacks. The amount of processing power and time needed to brute force a 128-bit key encrypted message makes whatever information that is being decrypted unactionable, as it could take decades to decrypt one message.

This does not mean that Twofish is impervious to all attacks, however. Part of Twofish’s encryption algorithm uses pre-computed, key dependent substitution to produce the ciphertext. Precomputing this value makes Twofish vulnerable to side channel attacks, but the dependence of a key with the substitution helps protect it from side channel attacks. Several attacks have been made on Twofish, but the creator of the algorithm, Bruce Schneier, argues these were not true cryptanalysis attacks. This means a practical break of the Twofish algorithm has not occurred yet.

What uses Twofish for encryption?

Though, like the Advanced Encryption Standard (AES), Twofish is not the most commonly used encryption algorithm, it still has many uses seen today. The most well-known products that use Twofish in their encryption methods are:

  • PGP (Pretty Good Privacy)

    PGP is an encryption algorithm that utilizes Twofish to encrypt emails. The data of the email is encrypted, but the sender and subject are not encrypted.

  • GnuPG

    GnuPG is an implementation of OpenPGP that lets users encrypt and send data in communications. GnuPGP uses key management systems and modules to access public key directories. These public key directories provide public keys published by other users on the Internet, so that if they send a message with encrypted with their private key, anyone with access to the public key directory can decrypt that message.

  • TrueCrypt

    TrueCrypt encrypts data on devices, with encryption methods that are transparent to the user. TrueCrypt works locally on the user’s computer, and automatically encrypts data when it leaves the local computer. An example would be a user sending a file from their local computer to an outside database. The file sent to the database would be encrypted as it leaves the local computer.

  • KeePass

    KeePass is a password management software that encrypts passwords that are stored, and creates passwords using Twofish.

Free Downloads

Datasheet of Encryption Consulting Services

Encryption Consulting is a customer focused cybersecurity firm that provides a multitude of services in all aspects of encryption for our clients.

Download
Encryption Services

About the Author

President at Encryption Consulting LLC focusing on providing consulting to customers in the Applied Cryptography space.

Let's talk