Encryption of string in Android SDK
<p>I need to encrypt String &amp; send to sever which is in php.</p>

<p>Below you will find encryption code and function to encrypt it. </p>

<pre><code>define('SALT', 'whateveryouwant'); 

function encrypt($text) 
{ 
        return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT,
$text, MCRYPT_MODE_ECB,
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),
MCRYPT_RAND)))); 
} 

function decrypt($text) 
{ 
        return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SALT,
base64_decode($text), MCRYPT_MODE_ECB,
mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_RIJNDAEL_256, MCRYPT_MODE_ECB),
MCRYPT_RAND))); 

} 
</code></pre>

<p>I tried out some classes in android but did not work at all.
Anybody having idea about the functions or classes in android which support this functionality?</p>

<p>Thanks in Advance</p>
