Format-preserving encryption (FPE)
Encryption whose output has the same format as its input, such as a 16-digit card number that stays 16 digits.
Format-preserving encryption (FPE) guarantees that the output has the same alphabet and length as the input. A 16-digit card number becomes another 16-digit number, which lets fields in existing databases be encrypted without changing the schema. Constructions usually rest on a Feistel structure or on cycle walking over a set of numbers, and a tweak is used to keep different contexts apart.
NIST published SP 800-38G in 2016, with FF1 and FF3. FF3 was attacked in 2017 in a way that showed it did not meet its security goal for all parameters, and NIST changed its recommendation. Anyone implementing FPE should use a reviewed variant rather than inventing their own.