Skip to content
uencoder

Order-Preserving Encryption

Order-preserving encryption (OPE) keeps the numeric order of plaintexts: if m1 < m2 then E(m1) < E(m2), enabling range queries directly on ciphertexts.

Purpose

It supports range queries and sorting on encrypted databases, executing BETWEEN and ORDER BY without decryption.

Mechanism

The plaintext domain [0,M] is mapped monotonically into the ciphertext domain [0,N] (N >> M to spread leakage), typically via an inverse cumulative distribution function. Security is weak: ciphertext gaps leak approximate plaintext gap information.

Use cases

  • Range queries on encrypted databases
  • Sorting encrypted columns
  • Encrypted database indexes

Related tools

References