The invention provides an order-preserving
encryption method, a
data query method and a data storage method. The order-preserving
encryption method comprises the following steps: acquiring
plaintext data, and performing order-preserving
random mapping on the
plaintext data to obtain first order-preserving coded data; carrying out decryptable
encryption processing on the
plaintext data to obtain decryptable
ciphertext data; and splicing the first order-preserving coded data and the decryptable
ciphertext data to obtain order-preserving
ciphertext data. And according to the size sequence relationship of the first order-preserving codes, operations such as sequence-related comparison sorting query and the like in the secret state
database can be quickly completed, and a plaintext form result corresponding to query is obtained. Compared with a common order-preserving encryption
algorithm, the order-preserving coding encryption method and device can realize an efficient and safe order-preserving coding encryption function with a controllable ciphertext length.