ReactJs - Hide state and props

为君一笑 提交于 2019-12-06 15:57:16

This isn't actually a ReactJS question, but a Web Browser / Internet architecture question. Unfortunately the data will always be available in the client to be intercepted, that's because they need the data at their end to be able to interact with the application. You have to rely on your user's browser extensions and internal security measures.

Nonetheless, you can make your data a little harder to understand. This won't prevent experienced "hackers" to read it, but might prevent some malicious user messing around with your application.

  • Minify the code and hide the source maps to make the debugging harder in the production environments.
  • Encrypt your data using base64 or some custom encryption technique to make it harder to be read.
  • If your code must run in unprotected environments (such as public WiFi) and that's a security concern, implement some kind of end-to-end encryption in your APIs.

And, the most important: only send to the client the data they actually need, data that is safe to be transmitted.

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