I haven't used that plugin, but it's from 2009, so it's pretty old now. I wouldn't put too much faith in it.
It's easy to decrypt/encrypt using Cake's Security::rijndael
, without using a plugin (note that the mcrypt php extension will need to be installed - but it may well be installed already).
First, in your model, add an array of the fields you want encrypted:
public $encryptedFields = array('mobile', 'body');
Then, implement a beforeSave like this:
public function beforeSave($options = array()) {
foreach($this->encryptedFields as $fieldName){
if(!empty($this->data[$this->alias][$fieldName])){
$this->data[$this->alias][$fieldName] = Security::rijndael($this->data[$this->alias][$fieldName], Configure::read('Security.key'), 'encrypt');
}
}
return true;
}
Your afterFind method should be pretty much the same, except it should decrypt rather than encrypt:
public function afterFind($results = array()) {
foreach($this->encryptedFields as $fieldName){
if(!empty($results[$this->alias][$fieldName])){
$results[$this->alias][$fieldName] = Security::rijndael($results[$this->alias][$fieldName], Configure::read('Security.key'), 'decrypt');
}
}
return $results;
}
Note I haven't tested all of that code - it's hacked together from bits and pieces in one of my own apps. But it should put you on the right track.