自定义应用程序加密
我目前正在寻求向服务器应用程序(用 C 语言编程)添加加密,该应用程序将原始数据、未加密数据通过 TCP 传递到客户端(用许多不同语言编程的大量不同应用程序)。
最好的方法是什么?公钥密码学?如果是这样,过程将如何进行?
谢谢!
I am currently looking to add encryption to a server application (programmed in C) that passes raw data, unencrypted data over TCP to clients (a large number of different applications programmed in many different languages).
What is the best way to do this? Public-key cryptography? If so, how would the process go?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
如果您不得不问,那么您可能没有资格从事加密工作。在加密处理中犯一个微妙的错误会破坏整个系统的安全性是非常容易的,并且与大多数其他错误不同,除非其他人破坏了您的系统,否则它根本不明显。
只需使用 SSL(又名 TLS)。设计 SSL/TLS 规范和库的人们已经为您完成了所有艰苦的工作。
If you have to ask, you're probably not qualified to be doing cryptographic work. It is far to easy to make a subtle mistake in crypto processing that breaks your entire system's security, and unlike most other bugs, it is not at all obvious until someone else breaks your system.
Just use SSL (aka TLS). The folks that designed the SSL/TLS specs and libraries have already done all the hard work for you.
SSL:安全套接字层,发起并传输加密数据。
TLS:传输层安全,要求启动TLS,答案是一个功能列表,然后传输可以继续使用最佳的双方接受的加密。
注意:这些功能可能包括明文。
我建议通过查看示例(例如 smtp starttls(rfc 2487))来了解如何扩展现有协议以支持 TLS。您投入的时间将会得到回报。
SSL: secure socket layers, which initiates and transmits encrypted data.
TLS: transport layer security, which asks to starttls and the answer to that is a list of capabilities, then the transmission can continue using the best mutually accepted encryption.
Note: the capabilities may include cleartext.
I suggest reading upon how to extend your existing protocol to support TLS, by looking at an example, say, the smtp starttls( rfc 2487 ). your time invested will be rewarded.
OpenSSL 适合我的需求!快速查看文档和教程为我指明了正确的方向。
OpenSSL suits my needs! A quick view at the documentation and tutorials pointed me in the right direction.