开发者

Encrypt/Decrypt Form Fields auto in Cake PHP

I was just wondering how to decrypt/encrypt form data in cakephp by creatin开发者_开发知识库g a behavior?

What I have so far:

$key = Configure::read('Security.cipherSeed'); Security::cipher($encrypt,$key)

debug($key);

function encrypt { var $autoEncrypt= 'true';}

function decrypt {}

Other than this I really could use some help.


It's not really clear what you're asking... you provided some code; is it working? Is it not working? What happens when you try to use it? Are there error messages? If so, what are they?

A shot in the dark anyway: have you considered using automatic decryption?

<?php 
class User extends AppModel
{
  var $name = 'User';

  var $actsAs = array('Cipher' => array('autoDecypt' => true));
}
?> 

There is a lot of info on the cipher-behavior here: http://bakery.cakephp.org/articles/view/cipher-behavior

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜