Delphi非对称加密
我正在寻找非对称加密算法的 Delphi 实现,而不依赖于外部 DLL。有可用的吗?
我的目标是使用公钥/私钥对加密/解密字符串(或字节数组)。
I'm looking for a Delphi implementation of an asymmetric encryption algorithm without any dependencies on external DLLs. Is there any available?
My goal is to encrypt/decrypt a string (or array of bytes) using a public/private key pair.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(6)
Eldos 的 SecureBlackBox 提供原生、全面的解决方案 - 包括证书管理和对外部加密设备(即 USB代币)
SecureBlackBox from Eldos offers a native, comprehensive solution - including certificate management and access to external crypto devices (i.e. USB tokens)
LockBox 现在已得到改进。它允许 RSA、AES 密码使用长密钥,并且正在积极开发中。
它是免费、开源和 100% 本机代码,没有 DLL。
LockBox is now improved. It allows long keys for RSA, AES cipher and is in active development.
It is free, Open Source and 100% native code with no DLLs.
您可以尝试Lockbox - http://sourceforge.net/projects/tplockbox/。它是免费的,包括 RSA 等(Blowfish、MD5、SHA-1、DES、三重 DES、Rijndael 和消息数字签名)。
它配有一个很好的 RSA 示例,演示如何生成公钥/私钥以及如何使用密钥实际加密和解密数据。
我目前正在将它与 Delphi 2010 一起使用。
You can try Lockbox - http://sourceforge.net/projects/tplockbox/. It's free and includes RSA among others (Blowfish, MD5, SHA-1, DES, triple-DES, Rijndael, & digital signing of messages).
It comes complete with a good RSA example that demonstrates how to generate your public/private keys and how to actually encrypt and decrypt data using the keys.
I'm currently using it with Delphi 2010.
我意识到最初的问题是“没有外部 DLL”,但在没有可接受的答案的情况下,也许您应该看看 OpenSSL DLL 以及此 Delphi 链接,其中包含导入该库的单元以及一些有关如何使用它的好示例,包括 RSA 加密。
我对此进行了修改并使其运行得很好。要使其与 unicode Delphi 一起工作需要进行一些更改 - 但这些主要与将 PChar 更改为 PAnsiChar 或 PBytes 有关。
简单的 Delphi 包装器现在允许我签名/验证/加密 sym 或 asym 并使用 SSL。老实说,OpenSSL DLL 的分发比某些 Microsoft 产品要简单得多。而且它是免费的并且维护得很好。
I realize that the original question stated "no external DLLs" but in the absence of an acceptable answer maybe you should take a look at the OpenSSL DLLs along with this Delphi link which contains an import unit for the library and some good examples on how to use it, including RSA encryption.
I have tinkered with this and got it working pretty well. There are some changes required to make it work with unicode Delphi - but these are mostly to do with changing PChar to PAnsiChar or PBytes.
Simple Delphi wrappers now allow me to sign/verify/encrypt sym or asym and use SSL. And let's be honest - the distribution of the OpenSSL DLLs is a lot more straightforward than some of the Microsoft offerings. Plus it's free and well maintained.
查看此站点上的 FGInt 包:http://submanifold.be/
如果您可以忍受使用 Windows服务,有加密 API: http:// /msdn.microsoft.com/en-us/library/aa380255(v=VS.85).aspx
如果您的目标是 Vista 及更高版本,则可以使用新的加密 API:下一代。这还支持椭圆曲线加密:http://msdn。 microsoft.com/en-us/library/aa376210(VS.85).aspx
Take a look at the FGInt package on this site: http://submanifold.be/
If you can stomach using Windows services, there is the Crypto API: http://msdn.microsoft.com/en-us/library/aa380255(v=VS.85).aspx
If you are targeting Vista and up, there is the new Cryptography API: Next Generation. This also supports Elliptic Curve crypto: http://msdn.microsoft.com/en-us/library/aa376210(VS.85).aspx
另一个非常好的、相当完整的软件包是 Delphi Encryption Compendium (DEC) 5.2。您可以从 http://www.torry.net 下载(免费源) /pages.php?id=519#939342。
Another very good fairly complete package is the Delphi Encryption Compendium (DEC) 5.2. You can download (Free with source) from http://www.torry.net/pages.php?id=519#939342.