Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
On Nov 30, 2011, at 7:38 PM, Matijn Woudt wrote: On Thu, Dec 1, 2011 at 1:14 AM, Rick Dwyer wrote: On Nov 30, 2011, at 5:13 PM, Matijn Woudt wrote: Your decrypt function seems fine, and the encrypt/decrypt functions work fine both in the same file for me. Now you say you use $_GET["myval"

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Matijn Woudt
On Thu, Dec 1, 2011 at 1:14 AM, Rick Dwyer wrote: > On Nov 30, 2011, at 5:13 PM, Matijn Woudt wrote: >>> >> >> Your decrypt function seems fine, and the encrypt/decrypt functions >> work fine both in the same file for me. Now you say you use >> $_GET["myval"], which means you get them from URL. Ba

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
On Nov 30, 2011, at 5:13 PM, Matijn Woudt wrote: Your decrypt function seems fine, and the encrypt/decrypt functions work fine both in the same file for me. Now you say you use $_GET["myval"], which means you get them from URL. Base64 is not URL safe, have you used urlencode()? Matijn OK,

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Matijn Woudt
On Wed, Nov 30, 2011 at 10:57 PM, Rick Dwyer wrote: > My decrypt is below: > > $myval=$_GET["myval"]; > > > // let the encryption begin > > define('SALT', 'myvalueforsalthere'); > > function decrypt($text) > { >    return trim(mcrypt_decrypt(MCRYPT_RIJNDAEL_256, SALT, > base64_decode($text), MCRYP

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
My decrypt is below: $myval=$_GET["myval"]; // let the encryption begin define('SALT', 'myvalueforsalthere'); 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,

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Matijn Woudt
On Wed, Nov 30, 2011 at 10:34 PM, Adam Richardson wrote: > On Wed, Nov 30, 2011 at 4:25 PM, Matijn Woudt wrote: > >> On Wed, Nov 30, 2011 at 10:18 PM, Adam Richardson >> wrote: >> > On Wed, Nov 30, 2011 at 4:14 PM, Matijn Woudt wrote: >> > >> >> On Wed, Nov 30, 2011 at 9:57 PM, Rick Dwyer >> w

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Adam Richardson
On Wed, Nov 30, 2011 at 4:25 PM, Matijn Woudt wrote: > On Wed, Nov 30, 2011 at 10:18 PM, Adam Richardson > wrote: > > On Wed, Nov 30, 2011 at 4:14 PM, Matijn Woudt wrote: > > > >> On Wed, Nov 30, 2011 at 9:57 PM, Rick Dwyer > wrote: > >> > Hello all. > >> > > >> > I am using the following func

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Matijn Woudt
On Wed, Nov 30, 2011 at 10:18 PM, Adam Richardson wrote: > On Wed, Nov 30, 2011 at 4:14 PM, Matijn Woudt wrote: > >> On Wed, Nov 30, 2011 at 9:57 PM, Rick Dwyer wrote: >> > Hello all. >> > >> > I am using the following function to encrypt a string: >> > >> > define('SALT', 'myvalueforsalthere');

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Adam Richardson
On Wed, Nov 30, 2011 at 4:14 PM, Matijn Woudt wrote: > On Wed, Nov 30, 2011 at 9:57 PM, Rick Dwyer wrote: > > Hello all. > > > > I am using the following function to encrypt a string: > > > > define('SALT', 'myvalueforsalthere'); > > > > function encrypt($text) > > { > >return trim(base64_en

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Adam Richardson
On Wed, Nov 30, 2011 at 3:57 PM, Rick Dwyer wrote: > Hello all. > > I am using the following function to encrypt a string: > > define('SALT', 'myvalueforsalthere'); > > function encrypt($text) > { >return trim(base64_encode(mcrypt_**encrypt(MCRYPT_RIJNDAEL_256, SALT, > $text, MCRYPT_MODE_ECB,

Re: [PHP] mcrypt_encrypt help needed

2011-11-30 Thread Matijn Woudt
On Wed, Nov 30, 2011 at 9:57 PM, Rick Dwyer wrote: > Hello all. > > I am using the following function to encrypt a string: > > define('SALT', 'myvalueforsalthere'); > > function encrypt($text) > { >    return trim(base64_encode(mcrypt_encrypt(MCRYPT_RIJNDAEL_256, SALT, > $text, MCRYPT_MODE_ECB, >

[PHP] mcrypt_encrypt help needed

2011-11-30 Thread Rick Dwyer
Hello all. I am using the following function to encrypt a string: define('SALT', 'myvalueforsalthere'); 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