{"id":335079,"date":"2022-05-15T07:12:08","date_gmt":"2022-05-15T07:12:08","guid":{"rendered":"https:\/\/webkul.com\/blog\/?p=335079"},"modified":"2024-07-22T13:45:37","modified_gmt":"2024-07-22T13:45:37","slug":"how-to-encrypt-and-decrypt-url-parameter-in-magento-2","status":"publish","type":"post","link":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/","title":{"rendered":"How to Encrypt and Decrypt URL Parameter in Magento 2"},"content":{"rendered":"\n<p>Hello Friends!!<\/p>\n\n\n\n<p>In this blog, we will learn how we can pass an encrypted request parameter in the GET method&#8217;s requests and decrypt the request parameter to use the value further.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><strong>What is Encryption?<\/strong><\/h3>\n\n\n\n<p><em>Encryption<\/em> is the process of translating plain text data (plaintext) into something that appears to be random and meaningless (ciphertext) that no one can understand.\u00a0<\/p>\n\n\n\n<p><strong>What is Decryption?<\/strong><br><em>Decryption<\/em> is the process of converting ciphertext back to plaintext.<br><br><strong>Why do we need encryption\/decryption?<\/strong><br>For Example, if we want to pass an id for any particular record row like product ID or user id, or entity id using URL, then we pass the URL as shown below:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">http:&#047;&#047;127.0.0.1\/magento\/routename\/controller\/actionname\/id\/1\/<\/pre>\n\n\n\n<p>In this case, if any unauthorized person found the URL, and passes the parameter, he\/she can delete\/view\/edit or perform any action (which is mentioned in the controller code) for all the records and destroy our business.<\/p>\n\n\n\n<p>So, to prevent your store from inauthentic access, use the below solution.<br><br><strong>Step1.<\/strong> We will create a <strong>Helper.php<\/strong> file inside the<em> app\/code\/Vendor\/Module\/Helper<\/em> directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Vendor\\Module\\Helper;\n\nuse Magento\\Framework\\Url\\DecoderInterface;\nuse Magento\\Framework\\Url\\EncoderInterface;\n\n\/**\n * helper class.\n *\/\nclass Data extends \\Magento\\Framework\\App\\Helper\\AbstractHelper\n{\n    \/**\n     *\n     * @param EncoderInterface $urlEncoder\n     * @param DecoderInterface $urlDecoder\n     * @param \\Magento\\Framework\\App\\Helper\\Context $context\n     * @param \\Magento\\Framework\\Encryption\\EncryptorInterface $encryptor\n     *\/\n    public function __construct(\n        EncoderInterface $urlEncoder,\n        DecoderInterface $urlDecoder,\n        \\Magento\\Framework\\App\\Helper\\Context $context,\n        \\Magento\\Framework\\Encryption\\EncryptorInterface $encryptor\n    ) {\n        $this-&gt;urlEncoder = $urlEncoder;\n        $this-&gt;urlDecoder = $urlDecoder;\n        $this-&gt;encryptor = $encryptor;\n        \n        parent::__construct($context);\n    }\n    \n    \/**\n     * @param $url\n     * @return string\n     *\/\n    public function encodeUrl($url)\n    {\n        return $this-&gt;urlEncoder-&gt;encode($url);\n    }\n \n    \/**\n     * @param $url\n     * @return string\n     *\/\n    public function decodeUrl($url)\n    {\n        return $this-&gt;urlDecoder-&gt;decode($url);\n    }\n    \n    \/**\n     * Encrypt string\n     *\n     * @param   string $str\n     * @return  string\n     *\/\n    public function encryptString($str)\n    {\n        return $this-&gt;encryptor-&gt;encrypt($str);\n    }\n\n    \/**\n     * Decrypt string\n     *\n     * @param   string $str\n     * @return  string\n     *\/\n    public function decryptString($str)\n    {\n        return $this-&gt;encryptor-&gt;decrypt($str);\n    }\n}<\/pre>\n\n\n\n<p><strong>Step2. <\/strong><span style=\"text-decoration: underline\"><strong>Encrypt the parameter:<\/strong> <\/span>You can encrypt the request parameter in your required file. Here I have created a controller<strong> Index.php <\/strong>inside the<em> app\/code\/Vendor\/Module\/Controller\/Index <\/em>directory. <\/p>\n\n\n\n<p><\/p>\n\n\n\n<p>In which, I have encrypted the value of the <strong>id<\/strong> request parameter and passed the <strong>id<\/strong> parameter in another controller <strong>GetParams.php<\/strong> file which is created inside the <em>app\/code\/Vendor\/Module\/Controller\/Index<\/em> directory.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Vendor\\Module\\Controller\\Index;\n\nuse Magento\\Framework\\App\\Action\\HttpGetActionInterface as HttpGetActionInterface;\nuse Magento\\Framework\\View\\Result\\PageFactory;\nuse Magento\\Framework\\App\\Action\\Context;\n\nclass Index extends \\Magento\\Framework\\App\\Action\\Action implements HttpGetActionInterface\n{\n    \/**\n     * @var \\Magento\\Framework\\Controller\\Result\\RedirectFactory\n     *\/\n    protected $resultRedirectFactory;\n\n    \/**\n     * @param Context $context\n     * @param \\Vendor\\Module\\Helper\\Data $demoHelper\n     * @param \\Magento\\Store\\Model\\StoreManagerInterface $storeManager\n     * @param \\Magento\\Framework\\Controller\\Result\\RedirectFactory $resultRedirectFactory\n     *\/\n    public function __construct(\n        Context $context,\n        \\Vendor\\Module\\Helper\\Data $demoHelper,\n        \\Magento\\Store\\Model\\StoreManagerInterface $storeManager,\n        \\Magento\\Framework\\Controller\\Result\\RedirectFactory $resultRedirectFactory\n    ) {\n        $this-&gt;demoHelper   = $demoHelper;\n        $this-&gt;_storeManager = $storeManager;\n        $this-&gt;resultRedirectFactory = $resultRedirectFactory;\n        parent::__construct($context);\n    }\n\n    \/**\n     * Index Controller Execute Method\n     *\n     * @return \\Magento\\Framework\\Controller\\Result\\Redirect|\\Magento\\Framework\\View\\Result\\Page\n     *\/\n    public function execute()\n    {\n        $userId = &quot;10&quot;;\n        $id = $this-&gt;demoHelper-&gt;encryptString($userId);\n\n        $encryptedId = $this-&gt;demoHelper-&gt;encodeUrl($id);\n\n        $redirectionUrl = &quot;&quot;;\n        $baseUrl = $this-&gt;_storeManager-&gt;getStore()\n            -&gt;getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_WEB);\n        $redirectionUrl = $baseUrl.&quot;demo\/index\/getParams\/id\/&quot;.$encryptedId;\n        \n        \/** @var \\Magento\\Framework\\Controller\\Result\\Redirect $resultRedirect *\/\n        $resultRedirect = $this-&gt;resultRedirectFactory-&gt;create();\n        $resultRedirect-&gt;setUrl($redirectionUrl);\n        return $resultRedirect;\n    }\n}<\/pre>\n\n\n\n<p><strong>Step3. <\/strong><span style=\"text-decoration: underline\"><strong>Decrypt the parameter:<\/strong> <\/span>You can decrypt the parameter value in your required file as in the following code. Here I have decrypted the <strong>id<\/strong> parameter&#8217;s value in <strong>GetParams.php<\/strong> controller as following:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\">&lt;?php\nnamespace Vendor\\Module\\Controller\\Index;\n\nuse Magento\\Framework\\App\\Action\\HttpGetActionInterface as HttpGetActionInterface;\nuse Magento\\Framework\\App\\ResponseInterface;\nuse Magento\\Framework\\Controller\\ResultInterface;\nuse Magento\\Framework\\App\\Action\\Context;\nuse Magento\\Framework\\App\\Action\\Action;\n\nclass GetParams extends Action implements HttpGetActionInterface\n{\n    \/**\n     * @param Context $context\n     * @param \\Vendor\\Module\\Helper\\Data $helper\n     * @param \\Magento\\Store\\Model\\StoreManagerInterface $storeManager\n     * @param \\Magento\\Framework\\Controller\\ResultFactory $resultFactory\n     *\/\n    public function __construct(\n        Context $context,\n        \\Vendor\\Module\\Helper\\Data $helper,\n        \\Magento\\Store\\Model\\StoreManagerInterface $storeManager,\n        \\Magento\\Framework\\Controller\\ResultFactory $resultFactory\n    ) {\n        $this-&gt;helper        = $helper;\n        $this-&gt;resultFactory = $resultFactory;\n        $this-&gt;_storeManager = $storeManager;\n        \n        parent::__construct($context);\n    }\n\n    \/**\n     * Execute Method to display the parameter value\n     *\n     * @return ResponseInterface|ResultInterface\n     *\/\n    public function execute()\n    {\n        $userIdHash = $this-&gt;getRequest()-&gt;getParam(&quot;id&quot;, &quot;&quot;);\n        $userId = 0;\n        if (!empty($userIdHash)) {\n            $decryptedHash = $this-&gt;helper-&gt;decodeUrl($userIdHash);\n            $decryptedHash = str_replace(&quot; &quot;, &quot;+&quot;, $decryptedHash);\n            $userId = (int)$this-&gt;helper-&gt;decryptString($decryptedHash);\n            echo &quot;USER ID:$userId&quot;;\n            die();\n        }\n        $resultRedirect = $this-&gt;resultFactory-&gt;create(\n            \\Magento\\Framework\\Controller\\ResultFactory::TYPE_REDIRECT\n        );\n        $redirectionUrl = $this-&gt;_storeManager-&gt;getStore()\n            -&gt;getBaseUrl(\\Magento\\Framework\\UrlInterface::URL_TYPE_WEB);\n        $result = $resultRedirect-&gt;setUrl($redirectionUrl);\n        return $result;\n    }\n}<\/pre>\n\n\n\n<p><strong>Step4. <\/strong>Now, when you will hit the<em> http:\/\/&lt;your-ip&gt;\/&lt;magentoroot-path&gt;\/demo\/index\/index<\/em> URL in the browser it will be redirected to the <strong>getParams<\/strong> controller and the result will be as in the following images:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1200\" height=\"217\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png\" alt=\"indexUrl\" class=\"wp-image-335080\" style=\"width:820px;height:148px\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-300x54.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-250x45.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-768x139.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1536x278.png 1536w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl.png 1688w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Run index controller in browser<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" width=\"1200\" height=\"214\" src=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/getParamsUrl-1200x214.png\" alt=\"getParamsUrl\" class=\"wp-image-335081\" srcset=\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/getParamsUrl-1200x214.png 1200w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/getParamsUrl-300x53.png 300w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/getParamsUrl-250x45.png 250w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/getParamsUrl-768x137.png 768w, https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/getParamsUrl.png 1458w\" sizes=\"(max-width: 1200px) 100vw, 1200px\" loading=\"lazy\" \/><figcaption class=\"wp-element-caption\">Result of Encrypted id parameter value after Decryption<\/figcaption><\/figure>\n\n\n\n<p>Hope this will be helpful.<br>Thanks \ud83d\ude42<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hello Friends!! In this blog, we will learn how we can pass an encrypted request parameter in the GET method&#8217;s requests and decrypt the request parameter to use the value further. What is Encryption? Encryption is the process of translating plain text data (plaintext) into something that appears to be random and meaningless (ciphertext) that <a href=\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\">[&#8230;]<\/a><\/p>\n","protected":false},"author":249,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9121],"tags":[12748,3361,12746,12749,12747,3360,12745,12744],"class_list":["post-335079","post","type-post","status-publish","format-standard","hentry","category-magento-2","tag-decrypt-the-request-param-in-magento-2","tag-decryption","tag-decryption-in-magento-2","tag-encrypt-and-decrypt-request-parameter-in-get-request","tag-encrypt-the-request-param-in-magento-2","tag-encryption","tag-encryption-in-magento","tag-how-to-encrypt-and-decrypt-url-parameter-in-magento-2"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Encrypt and Decrypt URL Parameter in Magento 2 - Webkul Blog<\/title>\n<meta name=\"description\" content=\"How to Encrypt and Decrypt URL Parameter in Magento 2, Encrypt and Decrypt URL in Magento 2, Encrypt and Decrypt URL in Magento 2\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Encrypt and Decrypt URL Parameter in Magento 2 - Webkul Blog\" \/>\n<meta property=\"og:description\" content=\"How to Encrypt and Decrypt URL Parameter in Magento 2, Encrypt and Decrypt URL in Magento 2, Encrypt and Decrypt URL in Magento 2\" \/>\n<meta property=\"og:url\" content=\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Webkul Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/webkul\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-05-15T07:12:08+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-22T13:45:37+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png\" \/>\n<meta name=\"author\" content=\"Khushboo Sahu\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@webkul\" \/>\n<meta name=\"twitter:site\" content=\"@webkul\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Khushboo Sahu\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\"},\"author\":{\"name\":\"Khushboo Sahu\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\"},\"headline\":\"How to Encrypt and Decrypt URL Parameter in Magento 2\",\"datePublished\":\"2022-05-15T07:12:08+00:00\",\"dateModified\":\"2024-07-22T13:45:37+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\"},\"wordCount\":344,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png\",\"keywords\":[\"decrypt the request param in magento 2\",\"decryption\",\"decryption in magento 2\",\"encrypt and decrypt request parameter in GET request\",\"encrypt the request param in magento 2\",\"encryption\",\"encryption in magento\",\"How to Encrypt and Decrypt URL Parameter in Magento 2\"],\"articleSection\":[\"Magento 2\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\",\"url\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\",\"name\":\"How to Encrypt and Decrypt URL Parameter in Magento 2 - Webkul Blog\",\"isPartOf\":{\"@id\":\"https:\/\/webkul.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png\",\"datePublished\":\"2022-05-15T07:12:08+00:00\",\"dateModified\":\"2024-07-22T13:45:37+00:00\",\"description\":\"How to Encrypt and Decrypt URL Parameter in Magento 2, Encrypt and Decrypt URL in Magento 2, Encrypt and Decrypt URL in Magento 2\",\"breadcrumb\":{\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl.png\",\"width\":1688,\"height\":305,\"caption\":\"indexUrl\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/webkul.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Encrypt and Decrypt URL Parameter in Magento 2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/webkul.com\/blog\/#website\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"name\":\"Webkul Blog\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/webkul.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/webkul.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/webkul.com\/blog\/#organization\",\"name\":\"WebKul Software Private Limited\",\"url\":\"https:\/\/webkul.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"contentUrl\":\"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png\",\"width\":380,\"height\":380,\"caption\":\"WebKul Software Private Limited\"},\"image\":{\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/webkul\/\",\"https:\/\/x.com\/webkul\",\"https:\/\/www.instagram.com\/webkul\/\",\"https:\/\/www.linkedin.com\/company\/webkul\",\"https:\/\/www.youtube.com\/user\/webkul\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca\",\"name\":\"Khushboo Sahu\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g\",\"caption\":\"Khushboo Sahu\"},\"url\":\"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Encrypt and Decrypt URL Parameter in Magento 2 - Webkul Blog","description":"How to Encrypt and Decrypt URL Parameter in Magento 2, Encrypt and Decrypt URL in Magento 2, Encrypt and Decrypt URL in Magento 2","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/","og_locale":"en_US","og_type":"article","og_title":"How to Encrypt and Decrypt URL Parameter in Magento 2 - Webkul Blog","og_description":"How to Encrypt and Decrypt URL Parameter in Magento 2, Encrypt and Decrypt URL in Magento 2, Encrypt and Decrypt URL in Magento 2","og_url":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/","og_site_name":"Webkul Blog","article_publisher":"https:\/\/www.facebook.com\/webkul\/","article_published_time":"2022-05-15T07:12:08+00:00","article_modified_time":"2024-07-22T13:45:37+00:00","og_image":[{"url":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png","type":"","width":"","height":""}],"author":"Khushboo Sahu","twitter_card":"summary_large_image","twitter_creator":"@webkul","twitter_site":"@webkul","twitter_misc":{"Written by":"Khushboo Sahu","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#article","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/"},"author":{"name":"Khushboo Sahu","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca"},"headline":"How to Encrypt and Decrypt URL Parameter in Magento 2","datePublished":"2022-05-15T07:12:08+00:00","dateModified":"2024-07-22T13:45:37+00:00","mainEntityOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/"},"wordCount":344,"commentCount":0,"publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png","keywords":["decrypt the request param in magento 2","decryption","decryption in magento 2","encrypt and decrypt request parameter in GET request","encrypt the request param in magento 2","encryption","encryption in magento","How to Encrypt and Decrypt URL Parameter in Magento 2"],"articleSection":["Magento 2"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/","url":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/","name":"How to Encrypt and Decrypt URL Parameter in Magento 2 - Webkul Blog","isPartOf":{"@id":"https:\/\/webkul.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage"},"image":{"@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage"},"thumbnailUrl":"https:\/\/webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl-1200x217.png","datePublished":"2022-05-15T07:12:08+00:00","dateModified":"2024-07-22T13:45:37+00:00","description":"How to Encrypt and Decrypt URL Parameter in Magento 2, Encrypt and Decrypt URL in Magento 2, Encrypt and Decrypt URL in Magento 2","breadcrumb":{"@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#primaryimage","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2022\/05\/indexUrl.png","width":1688,"height":305,"caption":"indexUrl"},{"@type":"BreadcrumbList","@id":"https:\/\/webkul.com\/blog\/how-to-encrypt-and-decrypt-url-parameter-in-magento-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/webkul.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Encrypt and Decrypt URL Parameter in Magento 2"}]},{"@type":"WebSite","@id":"https:\/\/webkul.com\/blog\/#website","url":"https:\/\/webkul.com\/blog\/","name":"Webkul Blog","description":"","publisher":{"@id":"https:\/\/webkul.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/webkul.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/webkul.com\/blog\/#organization","name":"WebKul Software Private Limited","url":"https:\/\/webkul.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","contentUrl":"https:\/\/cdnblog.webkul.com\/blog\/wp-content\/uploads\/2021\/08\/webkul-logo-accent-sq.png","width":380,"height":380,"caption":"WebKul Software Private Limited"},"image":{"@id":"https:\/\/webkul.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/webkul\/","https:\/\/x.com\/webkul","https:\/\/www.instagram.com\/webkul\/","https:\/\/www.linkedin.com\/company\/webkul","https:\/\/www.youtube.com\/user\/webkul\/"]},{"@type":"Person","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/f94b8f53397bf85810761d76c98fadca","name":"Khushboo Sahu","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/webkul.com\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/cabac965df656d114e6bf340df07518c990eda03bb09265dbd5c17f1097adaae?s=96&d=https%3A%2F%2Fcdnblog.webkul.com%2Fblog%2Fwp-content%2Fuploads%2F2019%2F10%2Feva.png&r=g","caption":"Khushboo Sahu"},"url":"https:\/\/webkul.com\/blog\/author\/khushboo-sahu062\/"}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/335079","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/users\/249"}],"replies":[{"embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/comments?post=335079"}],"version-history":[{"count":2,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/335079\/revisions"}],"predecessor-version":[{"id":454015,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/posts\/335079\/revisions\/454015"}],"wp:attachment":[{"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/media?parent=335079"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/categories?post=335079"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webkul.com\/blog\/wp-json\/wp\/v2\/tags?post=335079"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}