Is there any cryptosystem that works on floating point real number?

I see that all cryptosystems are work on finite field. But i consider that have any cryptosystem that works on real number (do not consider the round step and it also can be an estimate cipher)

• Hmm. I could've sworn this question was a duplicate, but my search only turned up questions specifically asking about floating-point CSPRNGs and hash functions. Apr 28, 2020 at 14:02
• @IlmariKaronen : This query found a closely related question, with a focus on hash.
– fgrieu
Apr 28, 2020 at 14:39
• A duplicate question with no answer Floating Point Homomorphic Encryption Schemes and another Homomorphic Public/Private Key Encryption Scheme for Floating Numbers that contains the references for you. Apr 28, 2020 at 14:43
• Apr 28, 2020 at 15:35
• Minor note: "Floating point real number" is a contradiction in terms. Sort of like a "compact monster truck" would be. Either it's floating point (usable in computers) or a real number (abstract concept). Reals can be represented as floating point with probability 0. Apr 28, 2020 at 16:16

2 Answers

One of the big problems in using floating-point as part of an encryption algorithm is round-off error. For more details, look at What Every Computer Scientist Should Know About Floating-Point Arithmetic and Round-off error (Wikipedia).

The basic problem is that in floating-point math, not only does round-off error occur, but you can't depend on different computers doing it consistently. Here is an example where the same source program gives different results (on the same system) depending on whether x87-based floating point (which stores numbers in a 80-bit format) was used rather than the SSE instructions (which use a more traditional 64-bit double precision float).

So to make a floating-point algorithm work, you would have to find a way of avoiding round-off error, while integers and bitstrings avoid that problem entirely.

• It's not the computer that can't do round-off consistently. It's the compiler. At the assembly code level you can set which rounding mode to use if your CPU supports more than one mode. And you can be confident what floating point format is used as well. If that fails or if a CPU doesn't support floating points at all, then each floating-point operation can be "emulated" in software using integer types. (Not that many high level languages or their existing compilers make any of this easy for users. Or even support it.) But, regardless, this isn't the primary reason why float ops aren't used Apr 28, 2020 at 22:28

I see that all cryptosystems are work on finite field.

No. Modern [1] cryptosystems usually work on bitstrings; you give them a bitstring (possibly limited to multiples of 8 in length) as plaintext, and they give you back a bitstring of ciphertext.

They may use finite fields internally, or they might not - depends on the internals of the cipher (which users generally shouldn't have to care about)

But i consider that have any cryptosystem that works on real number

That's easy; express your real number as a bitstring, and pass the bitstring to the modern cryptosystem - problem solved.

[1]: I say 'modern' to distinguish them from historic (pre-computer) ciphers, which tended to be more typically character based.

• Expressing certain real numbers as a bit string isn't an easy task. Apr 28, 2020 at 22:16
• @FutureSecurity: if you can't express it as a bit string, how do you intend to save it in computer memory, or on a flash drive, or send it across a network? Apr 29, 2020 at 11:52
• Sorry. That was basically the point. 🙃 There's also space for some dumb joke about how even if you stored numbers in symbolic format you're still only able to express next to zero percent of real numbers even ignoring all practical limitations of computers. Edit: Oh. Wait. Apr 29, 2020 at 15:18
• @FutureSecurity: well, yes, for any encoding, the real numbers that can be expressed in a finite symbol sequence is of measure zero (in Real Analysis terms). On the other hand, we have no practical way to compute with arbitrary real numbers with infinite precision... Apr 29, 2020 at 15:21