Every time we swipe our credit cards in a point-of-sale device, our credit card number is read. And we undoubtedly need to encrypt it to maintain security. Format Preserving Encryption, or FPE, is an encryption technology in which the format of the ciphertext output remains the same as the format of the plaintext input. So, if we encrypt a 16-digit credit card number using FPE, the encrypted output will be another 16-digit number.
But why do we need FPE, and how does it work? Let’s explore this in more detail.
What are the challenges of encrypting credit card numbers?
We can use a block cipher to encrypt credit card numbers. But, there are certain challenges with that approach.
- If we encrypt a 16-digit credit card number using a block cipher, the output will be 34 bytes long. This may break existing applications that expect the credit card number to be a 16-digit number only.
- The 34-byte ciphertext of a 16-digit credit card number obtained using block cipher will contain hexadecimal values containing alphanumeric and special characters. The ciphertext output may not be another credit card number, which may break existing applications.
- If the ciphertext is decrypted and encrypted again, it should retain its value. It should not depend on a random seed value to initialize the encryption, as it does in a block cipher.
What is Format Preserving Encryption (FPE)?
FPE is an encryption technology that encrypts credit card numbers so that the field length and data type of the plaintext credit card number are preserved across encryption. In other words, the encrypted output of a 16-digit credit card number will be another 16-digit number that can integrate well with existing applications.
So, we can say that FPE is like a random permutation, which, in this case, takes a 16-digit number as input and gives another 16-digit number as output. But for a large domain, it is infeasible to precompute a truly random permutation and remember it. FPE uses a secret key to generate a pseudorandom permutation of a number so that the computation time for a single value is less and computationally feasible.
0 Comments