Questions tagged [format-preserving]

Format-preserving encryption (FPE) refers to encrypting in such a way that the output has the same length as the input, or otherwise has the same format or structure as the input.

Filter by
Sorted by
Tagged with
24 votes
3 answers
2k views

Selective format-compliant JPEG encryption?

I am working towards building a format-compliant encryption system for pictures. The aim of it is to be able to obscure specific areas of a picture (i.e. faces, car license numbers...) while keeping ...
DashDotDashDot's user avatar
18 votes
3 answers
3k views

Can you create a strong blockcipher with small blocksize, given a strong blockcipher of conventional blocksize?

Suppose I want a strong 20-bit blockcipher. In other words, I want a function that takes a key (suppose the key is 128 bits), and implements a permutation from 20 bits to 20 bits. The set of ...
Fixee's user avatar
  • 4,158
11 votes
3 answers
4k views

Is there a length-preserving encryption scheme?

Is there a length-preserving encryption scheme, that preserves the lengths of input sizes such that the length of the input plain text is same as length of the output cipher text ?
Digerkam's user avatar
  • 219
10 votes
3 answers
3k views

Is there an encryption format that preserves length and only outputs alphanumerics?

I'm trying to design a promo code system for a server app I'm designing. Basically, I generate a promo code for a certain item and give the code out to someone, who then types it into the server. ...
Kaz Wolfe's user avatar
  • 203
10 votes
3 answers
2k views

What is the most computationally efficient way of generating pseudo-random permutations?

I have an application in which I need to create up to J randomly shuffled-copies of an array of length N. Then I will have millions or even billions of iterations such that, in each iteration, I will ...
user44353's user avatar
  • 101
10 votes
1 answer
2k views

Is there a format preserving cryptographically secure hash?

I want a way to 'scramble' strings (like words, names) in a predictable way but I don't ever want to (myself or anyone else) be able to 'unscramble' the strings. I found that perhaps what I am ...
erotavlas's user avatar
  • 507
7 votes
3 answers
3k views

Can I create a fixed length output from a fixed length input?

I use AES256 for various purposes in my app. However, the purpose I am now trying to achieve is the following: Input is for example AU00000001 and I would like a ...
Mark Anderson's user avatar
7 votes
1 answer
561 views

Does Format Preserving Encryption have significant advantages over a randomly generated lookup table?

I have a need to anonymise phone numbers so that I can carry out testing and analysis work on telecoms data sets and comply with GDPR. I typically receive a batch of a few hundred thousand events ...
sumidid's user avatar
  • 73
7 votes
1 answer
142 views

State of the art low memory arbitrary-domain PRP?

I am wondering what the state of the art is on low memory arbitrary-domain PRPs. That is, I'm looking for an algorithm that implements bijective function $PRP : \mathbb{Z}_n \times \{0, 1\}^b \...
orlp's user avatar
  • 4,230
7 votes
0 answers
144 views

FPE current state of art for "small" domains

Is there any survey with the state of art treatment of format-preserving encryption for small domains (i.e. 2^20 for example)? I believe that Stalling's and Rogaway's surveys are out of date due to ...
Kirill Tsar.'s user avatar
6 votes
6 answers
13k views

Relative security of a Vigenère cipher

Within a closed computer network, I am ciphering some plaintext data as an added security measure. This is below several other layers of protection. For various technical reasons, I am restricted to ...
Chris's user avatar
  • 163
6 votes
4 answers
2k views

Encryption algorithm that produces dummy output on incorrect passwords

Background: I've been thinking about using encryption in the context of backing up files to untrusted locations (to the point of making the file publicly and widely distributed for practically ...
Jack Singleton's user avatar
6 votes
3 answers
245 views

Are small domain keyed permutations inherently unsafe?

In the accepted answer to a question in Computer Science Stack Exchange, it was mentioned that a block cipher in counter mode makes a random number generator with a large bitspace, which visits every ...
Paŭlo Ebermann's user avatar
5 votes
3 answers
8k views

What algorithm would give the shortest ciphertext for very short plaintexts?

I have to encrypt some very short messages (approx. 5 characters) and I would like the ciphertext to be as short as possible. I am currently using AES but the initialization vector (IV) is making my ...
JoelFan's user avatar
  • 295
5 votes
2 answers
2k views

Can you help me understand Format Preserving Encryption?

I came across the definition of format-preserving encryption (FPE) as first defined in a seminal paper by Black and Rogaway. Based on their paper, FPE (or prefix cipher) is defined as follows (quoted ...
Hashed's user avatar
  • 185
5 votes
1 answer
1k views

Is it possible to generate a secure permutation F over 32-bit integers even if F(0) ... F(n) is public knowledge?

I'm currently interested in the problem of generating random-looking URLs from sequential database IDs, like how they do it in link shorteners. One way to do this is to encrypt the sequential database ...
hugomg's user avatar
  • 153
5 votes
1 answer
183 views

Cryptographically obfuscating IP addresses while preserving locality

In an online community, you sometimes have to ban certain IP addresses or even entire IP ranges due to abuse. You may hire moderators to help you with this, but you might not trust them enough to show ...
Isopod's user avatar
  • 53
5 votes
1 answer
343 views

What is the best way to pseudonymise IP addresses while retaining the ability to identify those that share a subnet?

Background: I'm developing an app that is based around registered users voting on stuff, and I want to create a heuristic that involves IP addresses as one way to flag accounts for further ...
Inkling's user avatar
  • 161
4 votes
2 answers
2k views

what are the uses of tweaks in block ciphers?

Few block cipher modes has additional parameter , tweaks , especially the ones that are format preserving . Now the comments section of this blog entry says such tweaks can be used for BIN numbers, ...
sashank's user avatar
  • 6,184
4 votes
1 answer
898 views

Using a hash (like SHA-256) vs AES as the source for pseudo-random values in Feistel network?

This question is in relation to Wikipedia article on Format Preserving Encryption It says the following It is also possible to make a FPE algorithm using a Feistel network. A Feistel network ...
erotavlas's user avatar
  • 507
4 votes
2 answers
934 views

Authenticated encryption without padding

I want to encrypt data and protect its integrity and confidentiality. However, I cannot increase the length of the data. Are there any cipher modes of operation which provide confidentiality and ...
Gev_sedrakyan's user avatar
4 votes
1 answer
1k views

How can AES + cycle walking be used as an FPE?

I'm a bit confused after reading several articles that seem to provide conflicting information. Basically I was wondering if AES by itself can be used as an FPE? And if so is this something ...
erotavlas's user avatar
  • 507
4 votes
2 answers
261 views

Coding of unsigned int to prevent guessing next ID

Suppose we are assigning records an unsigned integer ID from a N-bit space (say 32-bit) in a sequential manner. Is there a way we can code this ID before showing it to the public such that someone can'...
sstur's user avatar
  • 143
4 votes
1 answer
611 views

security in format preserving encryption

In format preserving encryption an attacker knows the format and data type of the plain text. The format of the plain text and cipher text are same. usually cipher text are unreadable form. then how ...
user3425935's user avatar
4 votes
1 answer
200 views

Statistical tests for pseudorandom permutations

I'm implementing a format-preserving encryption scheme similar to those described in the literature. I want to sanity test my PRP using some statistical tests like TestU01. However, I'm not sure how ...
pg1989's user avatar
  • 4,636
4 votes
1 answer
158 views

OTT service using FPE

Would it be possible to create an Over-The-Top communication utility that will encrypt voice using format preserving encryption (voice clear-text to audio encrypted stream) and send that over an ...
user1028028's user avatar
4 votes
1 answer
1k views

Asymmetric format preserving encryption?

I would like to encrypt a string asymmetrically. I would like the ciphertext to be as short as as plaintext. (or shorter) I've read about format preserving encryption functions - are there ...
Skip's user avatar
  • 167
3 votes
3 answers
2k views

Is there a cryptographic method to add noise to a plaintext instead of actually encrypting it?

I'm looking for a cryptographic technique that instead of permuting a cleartext, would add noise to the cleartext to obfuscate the true text among a bunch of garbage. For example, a list of 10 ...
argybargy3's user avatar
3 votes
2 answers
1k views

Best modern cipher for morse code?

I am looking for a modern cipher to encode morse code, ie. input is [A-Z 0-9] (base36 as I learned in the comments below) and output is the same, one character at a ...
Christian's user avatar
  • 163
3 votes
1 answer
495 views

Format preserving encryption FFX

In FFX mode the format of the ciphertext is same as plaintext. How does it ensure data integrity and authentication? Is there any bit flip attack in FFX mode? Is it malleable?
user3425935's user avatar
3 votes
1 answer
1k views

What is the difference between various modes in FPE?

Format preserving encryption has three modes FE1( FFX) , FE2(VAES) , FE3(BPS) . All of them are based on Feistel Networks .Can somebody explain how they differ from each other ?
sashank's user avatar
  • 6,184
3 votes
1 answer
861 views

How to select a 'tweak' used in FE1 mode format preserving encryption?

I'm experimenting with this library Botan which includes a module for format preserving encryption based on FE1 mode. The parameters for the Encrypt method are as follows ...
erotavlas's user avatar
  • 507
3 votes
3 answers
4k views

Format Preserving Encryption for 32 or 64 bit plaintext values

I am looking for a Format Preserving Encryption implementation to apply to either a 32-bit or a 64-bit integer. It looks like AES/FFX mode is just what I need in terms of established security ...
Tim's user avatar
  • 31
3 votes
1 answer
928 views

Is format preserving encryption suitable for use with words or names?

Is it possible to use FPE to encrypt names and language words like 'Bob' 'the' 'tree', in order to preserve both length and format (like keeping characters within a certain range like A-Z a-z) The ...
erotavlas's user avatar
  • 507
3 votes
1 answer
142 views

Does the timing of cycle-walking pose a threat?

Cycle-walking is a technique for format-preserving encryption that involves repeating an encryption process until the result is inside a desired range. For example, given an input P, a range R, and ...
Daffy's user avatar
  • 2,389
3 votes
0 answers
59 views

1-digit MAC with error-catching properties?

The well-known Luhn check digit (used in credit-card numbers) is a public method to append a check digit on the right of a decimal number, so that any 1-digit alteration and any exchange of two (...
fgrieu's user avatar
  • 141k
2 votes
2 answers
9k views

How to encrypt dates using format preserving encryption and avoid collisions

I'm encrypting with an FPE algorithm in C#. What I did is convert the date I want to encrypt to the day of year value and a year value like so. ...
erotavlas's user avatar
  • 507
2 votes
1 answer
638 views

Format Preserving Hash Function

We have a use case of tokenising the credit card information and returning a tokenised value after preserving the format. Ideally this should be one way, and following a FPE might not be the best ...
user3336696's user avatar
2 votes
1 answer
120 views

Is a naive 27bit FPE algorithm using AES-CTR insecure?

I don't have a deep mathematical background in cryptography. I am reading "The FFX Mode of Operation for Format-Preserving Encryption". Section D says the following. Why feistel? The ...
relent95's user avatar
  • 123
2 votes
2 answers
455 views

FPE Limitations and Scope of FPE

Do you think the format preserving encryption(FPE) schemes have any limitation with respect to other conventional block ciphers? Do FPE have a wide range of applications to be a future research area?
Novice_researcher's user avatar
2 votes
1 answer
78 views

Is there any block-cipher, format-preserving or similar encryption method with known cycle size? (without short-cut, with known source/runtime vars)

E.g. given a $n$-bit message $m_0$ and an encryption function $f$ After applying the function $c$ times it will result in $m_0$ again. $f^1(m_0) = f(m_0) = m_1$ $f^2(m_0) = f(f(m_0)) = f(m_1) = m_2$ .....
J. Doe's user avatar
  • 433
2 votes
2 answers
1k views

Very short block ciphers for equally-short plaintexts

I'm trying to develop an encryption technique for encrypting short phrases (such as reversibly-anonymized names) in text. The key-generation and ciphertext-representation details are fungible, but ...
Stuart P. Bentley's user avatar
2 votes
1 answer
1k views

How to encrypt email address using FPE?

Could anyone guide me on how to implement FPE (Format Preserving Encryption) for Email address masking? For example: if my ID is [email protected] then it should ...
user65343's user avatar
2 votes
1 answer
371 views

Why is the tweak length 64bit in BPS FPE algorithm?

In the algorithm for BPS Format Preserving Encryption Is this tweak always the same length (64bit)? Why did they choose the length 64bit for the tweak?
erotavlas's user avatar
  • 507
2 votes
1 answer
42 views

What are the number of output bits of the internal function F used in BPS algorithm?

In the BPS specification document it says We denote by f the number of output bits of the internal function F What is this if the internal function is AES? Would it be the block size (e.g. 128)?
erotavlas's user avatar
  • 507
2 votes
1 answer
194 views

SPI security of FE1 scheme

I have a question about security of FE1(Page 16-18) in paper "format preserving encryption". Can anyone explain me, why we are allowed to replace PRF with random function in security proof? And also, ...
user avatar
2 votes
1 answer
338 views

Hashing/encrypting an integer to produce an unique integer in the same range

I'm looking for a function or set of functions that can produce a pseudo-random permutation on an input set of arbitrary size. Given a set of $M$ values in range $0..M-1$, where $M$ is positive ...
Yann Droneaud's user avatar
2 votes
1 answer
106 views

Publicly verify that a a ticket was issued by an authority with around 8 digits

Im building a backend for webapp(s), so that we can sell tickets for our events. The events ranges from 100-700 guests. We sell tickets online and we would like to be able to scan the tickets at the ...
Alex's user avatar
  • 21
2 votes
1 answer
372 views

Unbalanced numeric Feistel network implementation

After reading a comprehensive paper [1] covering various kinds of generalized Feistel networks, I've tried to implement the Unbalanced Numeric Feistel variant, which relies on modular arithmetic for ...
0x2b3bfa0's user avatar
  • 123
2 votes
1 answer
219 views

Defining format-preserving encryption for natural language

Assume we have plaintext in natural language. Can we use format-preserving encryption in such a way that the produced ciphertext cannot be distinguished from natural language?
Pequenito's user avatar