Welcome Guest, Not a member yet? Register   Sign In
decrypt() returning incorrect result
#3

(02-17-2023, 05:20 PM)kenjis Wrote: It should work...
See https://codeigniter.com/user_guide/libra...y-with-ci3

Should, but it isn't. As a test, with the settings I listed, I was able to encrypt a plain text value, then decrypt it and they matched, so the decryption algorithm is working against it's own encryption. However, I tried encrypting the same plain text that was encrypted in a CI3 version of the same application and it encrypts to a completely different value.

In CI3 'hotdoggies' encrypts to:
Code:
756f4d370aaf4cdd16b5b6a2917883acb338d2d66d33521114bcbe495ae2b8f351c240be70a709d20f9a16517e824e5f1a8424d2731db02c701a6ae0678bc2ccMecjhJImsNP5ziPf03zRn3z0dS4phxXuK6Ga/Bqb36o=

In CI4 'hotdoggies' encrypts to:
Code:
30777d629b28662fce7b292c64e0f26393b8b7d9e4ac69a1ee271c3d0c620639be72bb833857e2316a4b1f766352d4b701a33cbfe29585e4ab4aa556a3abf87eKpiCg4Mqen/qzZ/xJi5ewwr1RQdhMA==

You can see they are yielding different results, which, then it isn't strange that decrypting a CI3 encrypted value using the CI4 decrypt() is producing an incorrect result. The seed is the same in both CI3 and CI4 versions.
Reply


Messages In This Thread
RE: decrypt() returning incorrect result - by objecttothis - 02-18-2023, 09:56 AM



Theme © iAndrew 2016 - Forum software by © MyBB