Could i store user geolocation data lat/lng unencrypted but cutted on my database

拟墨画扇 提交于 2019-12-11 19:15:10

问题


For a well performance on my server it`s essential that i can store latitude and longitude unencrypted. My application is based on location searches, almost every query needs to be filtered on location.
This means i have to decrypt each row of each query first before im able to get the correct rows. Thats a really big problem if there are many rows.

This way i tought for privacy i could store the values lat and lng cutted.
For example:

lat: 52.52835 
lng: 13.40547

->

lat: 52.528
lng: 13.405

Cutting on 3. decimal im recieving a rectangle with about ~ 50x80m. This might be no problem for still an accurate calculation.
Cutting on 2. decimal im recieving a rectangle with about ~ 400x700m. In worst case this can make a difference of 1km in calculation.
Instead i could add "5" as 3. decimal to improve the calculation up to 500m difference worst.

In some case it is possible that a single house is in the whole rectangle and the hacker could get the exact adress like that.

To solve that problem i could store the city location, but for bigger citys the calculation would get completely useless.

Now what you think if a hacker would be able to steal the data and get the unencrypted values, would this be a problem ?
Other suggestions to solve this problem ?

Edit:
I could also try to manipulate each value, with for example an offset to make it harder for an attacker, but that wouldnt be hard to remanipulate.


回答1:


How about making the split with . When saving to DB . Save left and right in a different column.




回答2:


Another opinion is If you have to remember by the number of letters You decide how many keys you have, and then you shift the number. This is something that only administrators should know, why not manage by setting up an anomalous key that maps to the key value of that record? There is no fixed solution.



来源:https://stackoverflow.com/questions/52309258/could-i-store-user-geolocation-data-lat-lng-unencrypted-but-cutted-on-my-databas

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!