encryption - PHP crypt and salt - more clarification please -


I went yesterday and I really got a very good answer. Whatever I took and what I mixed, I took it, which I think would be a very safe algorithm. I'm having trouble using a bluffish with a loop generating loop.

I am using base 64 characters and I am using a loop to get a random string. I want to take this generated string and insert it as a salt in crypt function.

Because the documentation about bluffs is very rare and PHP docs do not really mention it, I'm stuck in the dark here.

The odd thing is that if you run this code now, then it will fail no . Remove the crystal function from or to either with '$ 2a $ 07 $' and it will return an encrypted string from intestine . My understanding of bluffish is that the encrypted string starts with should '$ 2a $ 07 $' and ends in "$", so the inclusion in the crypt function. I really do not need a start string for loop and just wanted to get rid of it.

I would like to clarify the best practice on storing random salt, either by storing the output in the database or , what is the crypt function in the database?

Yesterday, there was no real code, just discussed. I still want to give some code together and there is something that is quite safe in the place. Can come with a better algorithm, I am always open.

  $ base64 = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 +/'; $ Salt = '$ 2a $ 07 $'; ($ I = 0; $ for I & lt; 60; $ i ++) {$ salt = $ Base64 [rand (0, 63)] return crypt ('password', '$ 2 $ 07 $'. $ Salt '' $ '');  

It looks like crypt () dislikes in the salt ( * , % etc.) in + char, and many other special characters. If you filter them, then it should work on every effort (and there is no need to repeat the salt id string).


Comments

Popular posts from this blog

sql - dynamically varied number of conditions in the 'where' statement using LINQ -

asp.net mvc - Dynamically Generated Ajax.BeginForm -

Debug on symbian -