加密在VBScript / ASP经典,解密PHP? [英] Encrypt in VBScript/ASP Classic, Decrypt in PHP?
问题描述
我期待加密在VBScript中的字符串,而在PHP中对其进行解密。我有过的VBScript / ASP Classic环境的完全控制,但在我的PHP环境零控制。
I'm looking to encrypt a string in VBScript, and decrypt it in PHP. I have full control over the VBScript/ASP Classic environment, but zero control over my PHP environment.
鉴于此,可我用什么样的加密,这将是足够充分的,以确保一个字符串?道歉问题的模糊性,但我不知道从哪里开始。
Given this, what sort of encryption could I use that would be adequate enough to secure a string? Apologies for the vagueness of the question, but I do not know where to begin.
推荐答案
你应该尽量简单地用标准的加密/解密算法的第一件事。
The first thing you should try is simply using a standard encryption/decryption algorithm.
的问题是,这些是由在PHP mcrypt扩展处理,并且可能会或可能不会有那么可用。
The problem is that these are handled by the php mcrypt extension and you may or may not have then available.
您想 mdecrypt_generic 。但是,你可以测试它:
You want mdecrypt_generic. But you can test for it with:
<?php
if(function_exists('mdecrypt_generic')){
echo "Fred says 'you are going to be OK!'";
}else{
echo "Fred says 'it is a shame you cannot control your php environment'";
}
?>
如果它存在,你用相同的算法和参数上的VBScript / ASP加密解密应该对PHP就好然后纯文本。要ppared尝试不同的算法,如果你得到有趣的结果$ P $,有时一个参数才能真正惹你了...如果你没有那么mcrypt的检查OpenSSL的。 openssl_seal 可以做同样的工作适合你,但你需要乱用在这种情况下X509的键。 (我喜欢 CACert.org 简单X509外包...)
If it exists then plain text that you encrypt with the same algorithm and parameters on VBScript/ASP should decrypt on PHP just fine. Be prepared to try different algorithms if you get funny results, sometime a "parameter" can really mess with you... If you do not have mcrypt then check for openssl. openssl_seal can do the same work for you, but you need to mess with x509 keys in that case. (I like CACert.org for simple x509 outsourcing...)
其他的事情要考虑...你真的需要加密或者仅仅是混淆一>
The other thing to consider... do you really need encryption or merely obfuscation?
HTH,
-FT
这篇关于加密在VBScript / ASP经典,解密PHP?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!