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

decrypt encrypted URL

I want to decrypt encrypted url with -HASH-

<?php echo $this->tag->linkTo(array("spm_contacto/edit/" . $this->security->hash($SPM_CONTACTO->CONT_CODIGO), "<img src='" . $this->url->get("img/tolbar/edit-validated32.png") . "'>")); ?></td>

But I find just check hash function to compare with another value I can not be decoded to receive it in a PHP function I want to receive to use this function

    $SPM_CONTACTO = SpmContacto::findFirstByCONT_CODIGO($CONT_CODIGO);


11.0k

I was give my example code for your old discussion. It didn't work ?



81.1k

not why I'm dealing with HASH in place Bcrypt

Hashing is one way, if you need to be able to reverse the value, then you want to encrypt it, not hash.



81.1k

encrypting any way that works to send the URL parameters and can decrypt on receipt I tried this way

use Phalcon\Crypt;
use Phalcon\Filter;
$CONT_CODIGO=$this->crypt->encryptBase64("contra")
$var = $filter->sanitize($this->crypt->decryptBase64(trim($CONT_CODIGO)), "alphanum");

This works only if I work in the same form if sending by URL parameters does not work and I need to encrypt the URL variables