-1

I'm using Cakephp 2.1.

How can I encrypt and decrypt a string.

Vijay
  • 53
  • 2
  • 10
  • You should really provide more details about what you want to do: what kind of string do you want encrypted and why, what kind of encryption? There's more than one kind of it... http://en.wikipedia.org/wiki/Encryption – bfncs Aug 23 '12 at 10:15

1 Answers1

1

As per CakePHP documentation:

Encrypt your secret password with my_key

$secret = Security::cipher('my secret password', 'my_key');

Later decrypt your secret password

$nosecret = Security::cipher($secret, 'my_key');

noslone
  • 1,301
  • 10
  • 14