I encrypt code id using below code


when I decrypt with below code


It is not getting real value for some problem of special character.


please try this code and check it's working or not


also try this code

        $this->_dataSaveAllowed = false;
        $value = (int)$quote->getId();
        // don't save value, if an obscured value was received. This indicates that data was not changed.
        if (!preg_match('/^\*+$/', $value) && !empty($value)) {
            $this->_dataSaveAllowed = true;
            $encrypted = $this->_encryptor->encrypt($value);
        } elseif (empty($value)) {
            $this->_dataSaveAllowed = true;

| improve this answer | |
  • no ites not work for me. – Jigs Parmar Oct 26 '17 at 2:47
  • some times its work like for value 5 its work but for vlaue 6 its not work – Jigs Parmar Oct 26 '17 at 2:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.