将VB6 AES Rijndael转换为PHP(作者:Phil Fresle)

I was trying to decrypt values from the database that have been encrypted with VB6 using AES256 Rijndael - the vb6 algorithm was written by Phil Fresle.

The problem is, that some things have changed since vb6 and php. In vb6, I just used the function by passing the value I wanted to encrypt and the key for it. In addition, the key was not so long as the algorithm itself padded it up with zeros. In PHP, I now don't know how to decrypt the values that have been encrypted with the vb6 aes implementation by Phil Fresle. I tried the following without success:

function decodeAES256($password)
{
    // $password here: 20D2E48C0A262B95852ABF5269488736504F728DF50A4D4BF72A5DFB8FB09925
    return mcrypt_decrypt(MCRYPT_RIJNDAEL_128, 'ThisIsSomeSecretKeySecretKey\0\0\0\0', password, MCRYPT_MODE_ECB);
}

The passwords have been encrypted in vb6 by using the key "ThisIsSomeSecretKeySecretKey\0\0\0\0" - running the code above will not decrypt to the correct password..?

Maybe, I clarify the question a bit:

  • Currently, the key that has been used in VB6 Encryption has 28 characters (I cannot post the real key here, but the key has the same length as "ThisIsSomeSecretKeySecretKey"), so for making the key to work and for enabling AES256 in Rijaendel128, I expand him by concatenating 4x "/0" -> "ThisIsSomeSecretKeySecretKey\0\0\0\0" to 32 characters / bit.

  • The VB6 function receives as input parameter only the key and the encrypted value for decryption.No $iv is being used. So I won't need it here as well?

  • When I try to decrypt a string, I receive very strange letters with the aboce code: "ãW┤ä▬→☻ûI¤═¦.ÌËS" is the result of "decrypting" an encrypted value.

Do I need to configure other parameters, or is the vb6 algorithm using different defaults or encoding?

Could I call the vb6 method by using COM-class when including the vb6 rijndael as a dll? If this would work in theory, where can I find the vb6 class as DLL?