Jump to content

decrypt rijndael with .net??


Recommended Posts

i want to decrypt file that i encrypt using php rijndael(aes),but iwant to decrypt it using .net

can anyone help me/

this is my encrypt and decrypt function code using php

<?php

 

 

        function my_encrypt($sString)

        {

          GLOBAL $sCryptoKey;

 

 

          $iIV = mcrypt_create_iv (mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,

        MCRYPT_MODE_ECB), MCRYPT_RAND);

 

 

          $sEncrypted = mcrypt_encrypt(MCRYPT_RIJNDAEL_256, $sCryptoKey,

  $sString,

        MCRYPT_MODE_ECB, $iIV);

 

 

          return($sEncrypted);

        } // End function my_encrypt

 

 

        function my_decrypt($sString)

        {

          GLOBAL $sCryptoKey;

 

 

          $iIV = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256,

        MCRYPT_MODE_ECB), MCRYPT_RAND);

 

 

          $sDecrypted = mcrypt_decrypt(MCRYPT_RIJNDAEL_256, $sCryptoKey,

  $sString,

        MCRYPT_MODE_ECB, $iIV);

 

 

          return(trim($sDecrypted));

 

 

        } // End function my_decrypt

        ?>

help me please

 

Link to comment
https://forums.phpfreaks.com/topic/43433-decrypt-rijndael-with-net/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.