# Integrity of format preserving Encryption

In this question regarding integrity of FPE, the main point of the answer is that:

FFX is not malleable. [...] FFX can provide integrity protection in very limited circumstances.

So I was wondering, in practice how does one enforce integrity of the data? For instance if the systems stores credit card information and expects the correct format, it will be impossible to append a MAC or something like that.

What are the current best practices for FPE?

• The notion of nonmalleable, Informally, in the context of encryption, the additional requirement is that given the ciphertext it is impossible to generate a different ciphertext so that the respective plaintexts are related. Under this definition, please re-read the second paragraph. Feb 25 '20 at 17:59

The exception that the answer you link to talks about is cases where plaintexts are redundantly coded—where the alphabet and length of the strings in which the messages are coded allows for $$M$$ distinct combinations, but there's only $$N < M$$ distinct valid messages and you can unambiguously distinguish these $$N$$ coded messages from the other $$M - N$$ invalid ones.
In that circumstance, if we encrypt messages with a non-malleable cipher, an attacker who forges a ciphertext only manages to hit upon one that decrypts to a valid plaintext with $$N/M$$ probability. In exceptional cases where $$N/M$$ is extremely small (say, $$2^{-128}$$) this could offer meaningful security, but if we're talking credit card numbers, which have a single checksum digit, it means an attacker's forgeries would be undetectable 10% of the time. Not good!