We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Encrypt / Decrypt with Phalcon

Hello folks,

anyone know if Phalcon have some kind of encrypt/decrypt function?

ex.:

$msg = new Messages();
$salt = "[email protected]#";

#secure
$secure_msg = $msg->mycolumnmsg->security->encrypt($salt);

#good to read
echo $secure_msg->decrypt($salt);

I couldn't find anything related in Phalcon's Documentation...



98.9k

Phalcon does not have implemented encryption facilities in the security component or any other component. You can use an encryption component provided by a third one by registering it in the di:

$di['encryption'] = function() {
    return new MyEncryption();
};
$this->encryption->encrypt($text);
$text = $this->encryption->decrypt($text);


98.9k
Accepted
answer

An encryption class is now available in 1.1.0:

https://docs.phalcon.io/en/1.1.0/reference/crypt.html

Great :) lighting fast development Waiting for green light when i can use 1.1.0 version in production

Is it possible to set this class encrypt/decrypt to not use backslah character in the encrypt output ?