Linux 下的 Capicom 解密
我有一个使用 Windows CAPICOM 库和 RC4 加密的数据库。 以下 PHP 脚本在 Windows 服务器上运行良好。
...
$oCapiCapi = new COM("CAPICOM.EncryptedData");
$oCapiCapi -> Algorithm = 1;
$oCapiCapi -> Algorithm -> KeyLength = 3;
$oCapiCapi -> SetSecret('OURveRYSecretKey');
...
$oCapiCapi -> Decrypt($orsd[1]);
$Decrypted = $oCapiCapi -> Content;
...
我想在 Linux 服务器上解密相同的数据库。 我应该怎么做呢? 我可以解密用CAPICOM加密的数据吗?
谢谢。
I have a database that encrypted with windows CAPICOM library with RC4. Following PHP script works fine on windows server.
...
$oCapiCapi = new COM("CAPICOM.EncryptedData");
$oCapiCapi -> Algorithm = 1;
$oCapiCapi -> Algorithm -> KeyLength = 3;
$oCapiCapi -> SetSecret('OURveRYSecretKey');
...
$oCapiCapi -> Decrypt($orsd[1]);
$Decrypted = $oCapiCapi -> Content;
...
I would like to decrypt the same database on linux server. How Should I do that? Can I decrypt the a data that encrypted with CAPICOM?
Thank you.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
CAPICOM 使用标准加密算法,例如 3DES。 如果您自己解析加密的缓冲区,您应该能够使用任何语言对其进行解码。
有关 CAPICOM 缓冲区的详细信息,请从此处开始:
http://www.jensign.com/JavaScience/dotnet/DeriveBytes/index.html html
如果您仅使用一种加密算法处理来自单一来源的数据,您应该能够显着简化缓冲区解析代码。
CAPICOM uses standard encryption algorithms such as 3DES. If you parse the encrypted buffers yourself, you should be able to decode them using any language.
For details on CAPICOM buffers, start here:
http://www.jensign.com/JavaScience/dotnet/DeriveBytes/index.html
If you're dealing with data from a single source using only one crypto algorithm, you should be able to simplify your buffer parsing code significantly.
这看起来是你最好的选择: http://sourceforge.net/projects/rc4crypt/
显然,如果您想让您的应用程序跨平台,您应该完全放弃 COM() ——但我知道此时这是否超出您的控制范围。
This looks like your best bet: http://sourceforge.net/projects/rc4crypt/
Obviously, if you want to make your application cross-platform, you should abandon COM() entirely -- but I understand if that's beyond your control at this point.