CakePHP 2.x how to store encrypted data in mysql?

I am working on a Cakephp 2.6 I’m trying to encrypt my data which i am storing into db
For example i have a function in controller which is saving data:

$data = $this->request->data;
$data['card_serial'] = Security::encrypt($data['card_serial'], SECURITY_CODE);
$this->Card->save($data);

And view, I’m trying to decrypt:

<td> <?php echo Security::decrypt($record['Card']['card_serial'], SECURITY_CODE); ?> </td>

I have done this but didnt work

Error: [CakeException] The data to decrypt cannot be empty.

You’ve probably already tried this, but just in case, make sure the data you expect is actually there, getting saved, and coming back out:

after your save:
debug($data['card_serial']);

and in your view, again:
debug($record['Card']['card_serial']);