I'm not getting the results I expect from CSecurityManager. I'm using it like this...
Yii::app()->getSecurityManager()->setEncryptionKey('secretkey');
$user = User::model()->find(1);
$user->test = Yii::app()->getSecurityManager()->encrypt('astring');
$user->save();
now when I retrieve the results I use this...
Yii::app()->getSecurityManager()->setEncryptionKey('secretkey');
$user = User::model()->find(1);
echo Yii::app()->getSecurityManager()->decrypt($user->test);
What i get back is gibberish i.e. encrypted text that does not match 'astring'. The column 'test' in my MySQL db is of BLOB datatype.
What's happening here that I'm not getting?

Help













