jquery post crypt / descrypt problem

Hii all,

$di->set('crypt', function ()use($config)
{
    $crypt = new Crypt(); $crypt->setKey($config->application->cryptSalt); return $crypt; }
);

i set di

and on my form

<input type="hidden" name="bid" class="bid" value="<?php echo $a = $this->crypt->encrypt($object->getid());?>"/>

its okey when i decrypt $a but when i want to jquery post via form serialize couldnt decrypt



16.4k

Hi!

I am not sure but I think you should encrypt it to base64 form and then decrypt it from base64 form.

It is described here in the docs: http://docs.phalconphp.com/en/latest/reference/crypt.html#base64-support

Does it work now?