Data Encryption Methods and their Advantages and Disadvantages
By Billy VanCannon, Director of Product Management  March 21, 2023
Protecting data has become a critical part of every organization’s operation. However, choosing the best method of data encryption can be difficult with all the available options. Here we discuss the various encryption methods available, the strengths and weaknesses of each, and approaches to simplify data encryption.
Data Encryption Algorithms
Encryption is the transformation of sensitive data (plaintext) into obfuscated data (ciphertext) using a mathematical algorithm and a key. The key is a random set of bits of a given length. To protect the data, the key must be kept secure.
Data encryption can be further broken down into two types, Symmetric and Asymmetric encryption.
Symmetric Encryption
In symmetric encryption, the same encryption key is used to both encrypt and decrypt the data. Therefore this single key must be kept confidential by all parties using it.
The most common symmetric encryption algorithm today is advanced encryption standard (AES), known for its security and being widely available.
AES can be deterministic or random. Deterministic means that for a given key and plaintext, the ciphertext is always the same, whereas random means the ciphertext is different every time. Random ciphertext values provide additional security when there are a small number of plaintext inputs, also known as lowcardinality. For example, a person’s age is between 0 and 122 so the cardinality is 123 possible inputs. At one extreme, the cardinality could be two, say the answer to, “Has patient been diagnosed with Type II Diabetes, true/false”. In that case, a deterministic system is not going to work well because a bad actor would only have to verify one person with or without diabetes and know everybody’s situation. However, a random system will have different values for every person providing additional security.
Asymmetric Encryption
Asymmetric encryption, also known as public key encryption, is a type of encryption that uses two different keys for encrypting and decrypting data. One key, known as the public key, is used for encryption and can be freely shared with anyone, while the other key, the private key, is kept secret and used for decryption. Alternately for digital signatures and authentication use cases, the private key is used to encrypt and the public key decrypts to validate the identity of the key holder.
Asymmetric encryption solves a major challenge with symmetric encryption in that it provides a secure way of exchanging sensitive information over insecure channels, such as the internet, without the need for a shared secret key. This is because only the person with the private key can decrypt the data, even though the public key used to encrypt the data is widely known.
One of the most commonly used examples of asymmetric encryption is the RSA algorithm, named after its inventors Ron Rivest, Adi Shamir, and Leonard Adleman.
Advantages and Disadvantages of Encryption Types
Symmetric Encryption  Asymmetric Encryption  
Advantages 


Disadvantages 


Format Preserving Encryption
Format Preserving Encryption (FPE) is a type of encryption that allows for the encryption of data while preserving its original format. Unlike traditional encryption, which typically produces ciphertext of fixed length, FPE produces ciphertext that retains the original length and format of the plaintext.
FPE is commonly used in situations where the format of the plaintext data is important, such as credit card numbers, social security numbers, and other types of sensitive data. By preserving the original format, FPE allows for encrypted data to be used in systems and applications that require the same format as the original plaintext data.
In 2016 NIST published SP 80038G defining FPE. It uses industry standard AES, along with the advantages of performance and security that brings, but the process is modified such that the ciphertext is the same length and format as the plaintext.
FPE has proven to be highly secure and performant with any cardinality of a million or more. This translates to any numerical data (09) with six or more digits; so phone numbers, social security numbers, national IDs, driver’s licenses, and credit cards easily meet this. Accordingly, most alphanumeric (09, AZ, az) data meets this need with shorter possible length, such as names and addresses. FPE output libraries can consist of numbers (09), letters (AZ, az) or both.
Partial FPE is also possible. For example, the social security number 111223333 could be partially obfuscated to 532583333 so that the last four digits can be used by customer support personnel to identify a client.
FPE has recently become the favorite algorithm of choice for most organizations migrating their data to the cloud. It provides assurances that the data will be protected while outside of their network boundaries, but also that it will not break any applications that expect data to be formatted in specific ways.
Confidential Computing and Privacy Enhanced Computation
The one downfall common to traditional data encryption methods is that operations doing math, searches, or sorts can’t be done on the ciphertext data. If an organization must do this type of operation but can’t allow the sensitive data itself to be decrypted, this is where privacy enhanced computation (PEC) comes into play. Privacy preserving analytics is another term. There are three competing versions.
Homomorphic Encryption is complex math done on the encrypted data to enable mathematical operations. The biggest challenge with this method is that it requires so much processing power that performance is slowed by orders of magnitude. As of today, it is mostly impractical.
Secure Multiparty Computation (SMPC) is a procedure where the sensitive data is broken into pieces and shared amongst several parties. The keys or secrets are also broken and distributed amongst the parties. The keys are combined using one of several methods and then the computations are done on all the data pieces in such a way that the results are calculated, but the individual inputs are meaningless. The downside to SMPC is it requires separate functions to act as the “parties” and do the computations resulting in some additional delay.
Private Enclave applies the concept of performing all memory and processing in a separate and highly secure portion of a computer processor. Intel processors provide this capability, and they call it “SGX.” The encrypted data goes in, it is decrypted and processed, then only the results are sent out. One downside to SGX is that distributed computing can’t be done since everything is confined to a single “enclave.” Additionally, your database processors all have to be Intel with SGX capabilities. Finally, several vulnerabilities in SGX have been found. Though this is true of every computing device and application and it is why patching and updates are part of all security practices.
Baffle implements PEC in database userdefined functions (UDF). Similar to SGX, UDFs allow operations on encrypted data by processing it within the UDF. Even the DBA isn’t able to access the decrypted data with this method. This has proven to be the best combination of security and performance.
Conclusion
Data encryption has become essential in safeguarding sensitive information for organizations of all sizes. The available encryption types include symmetric and asymmetric encryption, each with its own strengths and limitations. Symmetric encryption is faster and more efficient than asymmetric encryption, but it requires secure key management, while asymmetric encryption provides secure key distribution, making it highly scalable. Format Preserving Encryption (FPE) is a new type of encryption that preserves the original format of the plaintext, making it ideal for sensitive data like credit card numbers and social security numbers. With FPE, organizations can now protect their data in the cloud without compromising their applications’ data format, making it the algorithm of choice for most organizations migrating their data to the cloud.
Ideally, organizations should look for data encryption solutions that provide simplicity in deployment and management. Baffle’s solution uses a unique approach that does not require any application code to be modified, and simplifies management from a centralized console. Learn more here.