apache / shardingsphere-plugin

Provides plugins for ShardingSphere pluggable architecture.
https://shardingsphere.apache.org/
Apache License 2.0
22 stars 17 forks source link

Like Encrypt Algorithm problems. #46

Open acepilot3000 opened 3 months ago

acepilot3000 commented 3 months ago

This algorithm adds collisions for safety reasons, which can result in a reverse result of 1: N. This may result in different plaintext encrypted ciphertexts being the same, for example, A encrypted result is C, and B encrypted result is also C. In this case, when querying A, there should be both A and B in the query result, and the normal result should not have B.

acepilot3000 commented 2 months ago

10 and 12 using CHAR DIGEST LIKE encrypt algorithm, all results are 01. When querying 0, the encrypted result of 0 is 1, and both 10 and 12 will be queried.

RaigorJiang commented 2 months ago

10 and 12 using CHAR DIGEST LIKE encrypt algorithm, all results are 01. When querying 0, the encrypted result of 0 is 1, and both 10 and 12 will be queried.

If a 1 -> N digest algorithm is used, this may be unavoidable. For short texts, should another hash algorithm be designed?