title: Triple DES Mcrypt Replacement in PHP 7
body: <p>I have the following function that is written in php</p>
  <pre><code>function encrypt($string) {
          //Key
          $key = &quot;key&quot;;
  
          //Encryption
          $cipher_alg = MCRYPT_TRIPLEDES;
  
          $iv = mcrypt_create_iv(mcrypt_get_iv_size($cipher_alg,MCRYPT_MODE_ECB), MCRYPT_RAND); 
  
          $encrypted_string = mcrypt_encrypt($cipher_alg, $key, $string, MCRYPT_MODE_ECB, $iv);
          return base64_encode($encrypted_string);
          return $encrypted_string;
      }
  </code></pre>
  <p>A desktop application uses the same scheme to decrypt the generated string.Newer versions of PHP does not support mcrypt.How can i replace this code to achieve the same result?</p>