如何让PHP上传的数据在传输过程中安全?
我允许经过身份验证的用户使用我的 PHP 应用程序上传图像文件。 假设我已经内置了必要的安全性来确保文件本身有效,那么 http 传输的文件是否有可能以某种方式被拦截? 如果是这样,我该如何保护文件的传输? HTTPS 会是正确的选择吗?
此外,应用程序所在的 Web 服务器只能由经过身份验证的用户访问。 这是否意味着http数据流也受到保护? 在我看来确实如此。
I'm allowing authenticated users to upload image files with my PHP application. Assume I've built in the necessary security to make sure the file itself is valid, is there a possibility of the http transmitted file to be intercepted in some way? If so, how can I protect the transmission of the file? Would HTTPS be the way to go?
Also, the web server the application resides on can only be accessed by authenticated users. Does this mean that the http stream of data is also protected? It would seem to me that it is.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您使用 HTTPS,建立连接后的整个通信将通过 SSL 加密传输。 因此,文件上传也将被加密发送。
If you use HTTPS, the whole communication after establishing the connection will be transfered encrypted over SSL. Thus the file uploads will be sent encrypted too.
如果中间有Main在中间,他就可以嗅探到传输的文件。 您必须使用安全连接才能防止这种情况发生。 所以 HTTPS 就是答案。
If there is Main in The Middle, he can sniff the contents of the transmitted file. You must use a secure connection in order to prevent this. So HTTPS would be the answer.
是的,如果要确保数据不被拦截,请使用HTTPS。
Yes, use HTTPS if you want to ensure that the data can not intercepted.
另外,检查上传的文件是否确实是图像而不是脚本。
also, check if the uploaded file really is an image and not a script.