Issue with Encrypting |
Hi,
I try to use the Encrypting Libary but the returning string everytime something like this: Code: 1?dӑ??U?v??(?I??-???1??4R|?5K??k?Tu???`??X?^?l4??p@????G6??QšC?X?h???O???o and this makes decrypting obviously impossible.. My encoding is UTF-8 everywhere ( in Database and the File encoding ) I tried googling for a solution already but only found thing like doing it with base64_encode/decode but there the error persists..
Hi, what do you mean impossible? It's in the guide, you gotta turn it into a string with bin2hex and store it in your code like this: $key = hex2bin(<your hex-encoded key>);
https://codeigniter.com/user_guide/libra...or-results
You can see things I made with codeigniter here: itart.pro its not overly impressive as I have very little time to learn.
Still getting
Code: Decrypting: authentication failed. Code is just a quick and dirty version of it...so dont wonder about it PHP Code: /** Can be closed, solved the problem. You should'nt save your encrypted string into a varchar(100) coulmn :$
You should save it as BINARY or VARBINARY, then you don't need to turn it into HEX.
If this is for an Auth system you should be using php password_hash methods.
Paragon Initiative Enterprises Blog. Implementing Secure User Authentication in PHP Applications with Long-Term Persistence (Login with "Remember Me" Cookies) PHP Net. PHP.NET - Password Hashing What did you Try? What did you Get? What did you Expect?
Joined CodeIgniter Community 2009. ( Skype: insitfx )
|
Welcome Guest, Not a member yet? Register Sign In |