2012-04-11 04:51
浏览 34


I have designed a webpage using HTML and client side validation using JavaScript.PHP for server side.I want to encrypt the fields before it is transmitted over network,I have encryption code written in JAVA.Can anybody give me a solution as how can I incorporate java code for encryption?Or any better way for encryption?

Any help is greatly appreciated.


图片转代码服务由CSDN问答提供 功能建议

我设计了一个使用HTML和客户端验证的网页,使用JavaScript.PHP作为服务器端。我想加密 在通过网络传输之前的字段,我有用JAVA编写的加密代码。任何人都可以给我一个解决方案,我如何将java代码加入加密?或者更好的加密方式?



  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

3条回答 默认 最新

  • duandun2136 2012-04-11 05:13

    An example of AES encryption using JavaScript can be found here. Depending on your use case, https encryption may be a better option, or can at least provide an additional layer of privacy. I think the key question to ask yourself is whether the data on the server should be opaque to anyone but the client. If the server is going to use the data in its plaintext form, then https is a relatively safe, easy and robust option. If the server doesn't need the data, then having the user encrypt at the client in JavaScript would allow your server to maintain those sensitive fields in a way that would be useless to your own employees, but useful to the client who could regenerate the same key to decrypt it.

    点赞 评论
  • dqf60304 2012-04-11 04:54

    I think a better way would be using https if you have the option to do so. Why reinvent the wheel?

    点赞 评论
  • doulan8330 2012-04-11 04:55

    If you want to encrypt on client side and decrypt on server side, you'll have to do it with javascript on client side; maybe you can do it with an applet and that way use Java on client side, but that seems troublesome.

    I think you better look into https.

    点赞 评论

相关推荐 更多相似问题