本文介绍了加密VBScript / ASP Classic,在PHP中解密?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在加密VBScript中的一个字符串,并用PHP解密。我完全控制了VBScript / ASP Classic环境,但是对我的PHP环境没有任何控制。



鉴于此,我可以使用哪种加密方式足够固定一个字符串?对于这个问题的模糊性道歉,但我不知道从哪里开始。

解决方案

你应该尝试的第一件事是简单的使用标准的加密/解密算法。



问题是这些是由php mcrypt扩展名处理的,您可能也可能没有可用的。



你想要。但是您可以通过以下方式进行测试:

 <?php 

if(function_exists('mdecrypt_generic ')){
echoFred说'你会好起来!'
} else {
echoFred说这是一个耻辱,你无法控制你的php环境;
}

?>

如果存在,则使用相同的算法和VBScript / ASP上的参数加密的纯文本应解密在PHP上就好了准备尝试不同的算法,如果你得到有趣的结果,有时一个参数真的可以弄乱你...如果你没有mcrypt然后检查openssl。 可以为您做同样的工作,但您需要在这种情况下混乱x509键。 (我喜欢简单的x509外包...)



另一件事要考虑...你真的需要加密,还是只需要?



HTH,



-FT


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.

The problem is that these are handled by the php mcrypt extension and you may or may not have then available.

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'";
}

?>

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 Classic,在PHP中解密?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 03:41