指向C#加密到PHP解密

I'm working on a project where I'm connecting to a mssql server and pulling encrypted data from an azure database. I'm connecting to this via a linux server and trying to decrypt the data in php.

I don't have control over the .net c# encryption but the code used is here.

My php decrypt function looks like the below but all I get is a random mixture of characters like this: wN�N��z��%��(�(�Z������0+���]��91�q� _��

 class Foo {
      protected $mcrypt_cipher = MCRYPT_RIJNDAEL_128;
      protected $mcrypt_mode = MCRYPT_MODE_CBC;

      public function decrypt($key, $iv, $encrypted)
      {
        return mcrypt_decrypt($this->mcrypt_cipher, $key, base64_decode($encrypted), $this->mcrypt_mode, $iv);
      }

      public function encrypt($key, $iv, $password)
      {
        $block = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_ECB);
          $padding = $block - (strlen($password) % $block);
          $password .= str_repeat(chr($padding), $padding);
        return mcrypt_encrypt($this->mcrypt_cipher, $key, $password, $this->mcrypt_mode, $iv);
      }
    }
    $foo = new Foo;
    $pass = 'PEMFISVOTSSB';
    $salt = 's@ltValue';

    $key = PBKDF1($pass, $salt, 2, 32);

    $iv = "1234567891234567";

    $encrypted = $foo->encrypt($key,$iv,'test@123');

    $encrypted = base64_encode($encrypted);

    $vb = "Du5ax6fFz6IvBuis0BAqxudWKmD/RgxIOmb7tEaEILoA";

    echo "<br /><br />";
    echo 'Encrypted: '.$encrypted.'</br>';
    echo "<br /><br />";
    echo 'Decrypted: '.$foo->decrypt($key, $iv, $encrypted);
    echo "<br /><br />";
    echo 'Decrypted from VB.net: '.$foo->decrypt($key, $iv, $vb);
    echo "<br /><br />";



    function PBKDF1($pass, $salt, $count, $cb)
    {
      static $base;
      static $extra;
      static $extracount= 0;
      static $hashno;
      static $state = 0;

      if ($state == 0)
      {
        $hashno = 0;
        $state = 1;

        $key = $pass . $salt;
        $base = sha1($key, true);
        for($i = 2; $i < $count; $i++)
        {
          $base = sha1($base, true);
        }
      }

      $result = "";

      if ($extracount > 0)
      {
        $rlen = strlen($extra) - $extracount;
        if ($rlen >= $cb)
        {
          $result = substr($extra, $extracount, $cb);
          if ($rlen > $cb)
          {
            $extracount += $cb;
          }
          else
          {
            $extra = null;
            $extracount = 0;
          }
          return $result;
        }
        $result = substr($extra, $rlen, $rlen);
      }

      $current = "";
      $clen = 0;
      $remain = $cb - strlen($result);
      while ($remain > $clen)
      {
        if ($hashno == 0)
        {
          $current = sha1($base, true);
        }
        else if ($hashno < 1000)
        {
          $n = sprintf("%d", $hashno);
          $tmp = $n . $base;
          $current .= sha1($tmp, true);
        }
        $hashno++;
        $clen = strlen($current);     
      }

      // $current now holds at least as many bytes as we need
      $result .= substr($current, 0, $remain);

      // Save any left over bytes for any future requests
      if ($clen > $remain)
      {
        $extra = $current;
        $extracount = $remain;
      }

      return $result; 
    }

?>

Encrypting and decrypting data from php works perfectly but trying to decrypt the .net encoded string does not work. The .net strings look much longer than anything I encrypt in php: e.g of .net encrypted string "4JKdUt2OIn8B1jAeCLpMs2sQmylWukYwikjS5VbBS/4A" vs e.g of my php encoded string: cBikJ072aEsa4xtoxP3RcA==

Any pointers on replicating this c# code in php would be greatly appreciated or pointers from someone who has worked with decrypting in php from a c# encryption.