The invention relates to a
ciphertext indexing method for
database encrypted fields and an in-base
encryption system and belongs to the field of
information security technology. According to the method, first, identification ID is mapped to
encryption ID based on an encrypted field P1, (
encryption ID, Hash value) is saved into a T2(ID2, P2), finally, a
ciphertext index table T2 is established, and the table where the encrypted field P1 exists is recorded as T1, wherein the table T2 comprises a
ciphertext index field P2, and fields ID2 in one-to-one correspondence with records in the T1 are recorded in the T2; and then, content of a to-be-encrypted field is mapped to the Hash value based on an order-preserving
Hash function, equivalent query and range query of the encrypted field are realized based on the Hash value obtained after the
record of the content of the to-be-encrypted field is mapped to the Hash value based on an encryption function, decryption is performed on the recorded ID2 according to query results to obtain a
record set in the T1, and the
record set is returned. Compared with the prior art, the method is good in reliability and high in universality, meanwhile has
high security and can guarantee extremely high retrieval and
storage efficiency.