i'm new to php password hashing since i'm also a beginner in php coding. I was able to make a simple login form, it requires a username and password. This password will then be saved to a database by Inserting into table using $_POST['password']. However i read that this is unsafe because its a plain text, you need to hash it.   I tried researching about password hashing in php. i found several write-ups but most of it are not clear for a beginner like me. Though i got some basic ideas but can't think on how to implement it.  Some of my questions: 1. How do I hash the password inputted by the user? 2. Once it is hashed, how do i pass it and save it to my database? 3. Is the password will then be saved as a hash (not plain text) in my database? if so, do i need to extend field length in my database to accommodate long hash passwords?  Those are some of my queries which is obviously from a beginner. I hope someone would enlighten me or show me where to start. I prefer basics so that I can comprehend.   Thank you very much!  EDIT: ok found some answers on the link provided. Thanks for tagging it as duplicate and i'm sorry for that. cheers!!
It is currently said that MD5 is partially unsafe. Taking this into consideration, I'd like to know which mechanism to use for password protection.  This question,   suggests that hashing multiple times may be a good idea, whereas  suggests using salt.  I'm using PHP. I want a safe and fast password encryption system. Hashing a password a million times may be safer, but also slower. How to achieve a good balance between speed and safety? Also, I'd prefer the result to have a constant number of characters.   The hashing mechanism must be available in PHP It must be safe It can use salt (in this case, are all salts equally good? Is there any way to generate good salts?)   Also, should I store two fields in the database (one using MD5 and another one using SHA, for example)? Would it make it safer or unsafer?  In case I wasn't clear enough, I want to know which hashing function(s) to use and how to pick a good salt in order to have a safe and fast password protection mechanism.  Related questions that don't quite cover my question:
Forward an invocation of a variadic function in C In C, is it possible to forward the invocation of a variadic function? As in,  int my_printf(char *fmt, ...) {     fprintf(stderr, "Calling printf with fmt %s", fmt);     return SOMEHOW_INVOKE_LIBC_PRINTF; }   Forwarding the invocation in the manner above obviously isn't strictly necessary in this case (since you could log invocations in other ways, or use vfprintf), but the codebase I'm working on requires the wrapper to do some actual work, and doesn't have (and can't have added) a helper function akin to vfprintf.  [Update: there seems to be some confusion based on the answers that have been supplied so far. To phrase the question another way: in general, can you wrap some arbitrary variadic function without modifying that function's definition.] I am using Ubuntu 16.04 LTS . I have python3 installed. There are  two versions installed, python 3.4.3 and python 3.6 . Whenever I use python3 command, it takes python 3.4.3 by default. I want to use python 3.6 with python3. python3 --version shows version 3.4.3 I am installing ansible which supports version &gt; 3.5 . So, whenever, I type ansible in the terminal, it throws error because of python 3.4 sudo update-alternatives --config python3 update-alternatives: error: no alternatives for python3 How should a family with young children apply for UK visas? Is it possible to set the GPU fan speed using the default free ati driver?  My card (X1900) was deprecated in the fglrx drivers a while back.  The free drivers seem to work with 3D, Compiz and such, but running graphics intensive programs makes my GPU heat up and produce artifacts, while the GPU fan never seems to increase. (When set to 100% in Windows it makes a massively louder noise.) When running sudo apt-get update I get these following errors:  Err archive.ubuntu.com quantal InRelease Err archive.ubuntu.com quantal-updates InRelease Err archive.ubuntu.com quantal-backports InRelease Err archive.ubuntu.com quantal-security InRelease Err archive.ubuntu.com quantal Release.gpg   Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Err archive.ubuntu.com quantal-updates Release.gpg   Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Err archive.ubuntu.com quantal-backports Release.gpg   Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Err archive.ubuntu.com quantal-security Release.gpg   Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] Reading package lists... Done W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal/InRelease   W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-updates/InRelease   W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-backports/InRelease   W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-security/InRelease   W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-updates/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-backports/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Failed to fetch archive.ubuntu.com/ubuntu/dists/quantal-security/Release.gpg  Unable to connect to archive.ubuntu.com:http: [IP: 91.189.92.177 80] W: Some index files failed to download. They have been ignored, or old ones used instead.   I am using Ubuntu 12.04. This is the command I used after installing Ubuntu from window installer. I am sure my laptop is connected to internet. What can I do now? Towards the end of , it's revealed that Borden accomplishes his Transported Man trick by using his twin brother, Fallon, as a double. It then becomes clear that he has been doing this in his personal life as well as on stage - each brother leads 'half a life', sometimes appearing as Borden and sometimes as Fallon. This is how he completes the illusion: one Borden goes into the first door, the other Borden emerges from the second door a moment later. Angier doesn't know how Borden does the trick, and doesn't believe Borden uses a double despite being told as much by Cutter. He follows what he believes to be a clue in Borden's notebook and travels to Colorado to meet Nikola Tesla, who Angier believes can build a machine that can help him perform the trick. Angier believes that Tesla built a similar machine for Borden. However, the final pages of the notebook reveal that Tesla was merely a red herring, designed to get Angier out of Borden's way for a long time. Tesla, it turns out, had never built such a machine before. At this point, Tesla agrees to build Angier's machine anyway. Instead of building a machine that transports matter, he builds one that duplicates it. Angier uses this machine in his act, but in order to avoid having to deal with multiple clones (the &quot;prestige materials&quot;), one of them must die as part of the act. This all makes sense, so far, but I find it hard to believe that Borden's use of the word 'Tesla' as the key to his cipher is random. It's too coincidental that he sends Angier on a wild goose chase, but Angier returns with a working machine. A film that is otherwise so tightly plotted shouldn't rely on coincidence to move the narrative forward, so there must be something else going on. Is it possible that Borden cloned himself using Tesla's machine? How do I enable auto-login in LightDM? We currently have about 50 pages, each of which I want a user (eg, bob, rob, smith) to be able to edit only 1 page.  For example, bob &amp; smith each have their own page.  I do not want bob to be able to edit smith's page.  I want bob to ONLY be able to edit bob's page.  I don't care if he can see other pages. Looking through the user roles, I don't see a way to currently to do this- I only see how to allow restrict access on a global scale.  Are their any plugins to help restrict edit access per user, or roles restricted to editing specific pages and I can just add 1 user per role?  Or was there a way to do this with default settings I missed. Regular expression to match balanced parentheses Arabic Stack Exchange? I have been learning some Arabic mostly for fun. I am looking for the Arabic Stack Exchange site but cannot find it. I am sure I saw it lying around a few months ago or so. Any idea what happened to it? How do I set a featured image (thumbnail) by image URL when using wp_insert_post()? While looking through the , I noticed that there's no parameter in the array it requires which will allow me to set the 'Featured Image' for a post, displayed as the  in my theme.   I have looked into functions like , as suggested by Mr. Bennett, but this seems to be a relatively new addition to WordPress itself and the WordPress codex. As such, there aren't any sources that I can find which explain how the $thumbnail_id parameter should be acquired and supplied. If this really is the function to use, in what way could I provide it with a valid $thumbnail_id parameter when all I have is an image URL?  Thanks in advance! Computing dominant area in polygon using ArcGIS Desktop? I recently upgraded a c# windows service to run as a 64 bit .net process. Normally, this would be trivial, but the system makes use of a 32-bit DLL written in C++. It is not an option to convert this DLL to 64 bit, so I wrapped the DLL in a separate 32 bit .net process and exposed a .net interface via remoting.  This is quite a reliable solution, but I would prefer to run the system as a single process. Is there any way I can load my 32 bit DLL into a 64 bit process and access it directly (perhaps through some sort of thunking layer)? How to show path-connectedness of $GL(n,\mathbb{C})$ Well, I am not getting any hint how to show $GL_n(\mathbb{C})$ is path connected. So far I have thought that let $A$ be any invertible complex matrix and $I$ be the idenity matrix, I was trying to show a path from $A$ to $I$ then define $f(t)=At+(1-t)I$  for $t\in[0,1]$ which is possible continous except where the $\operatorname{det}{f(t)}=0$ i.e. which has $n$ roots and I can choose a path in $\mathbb{C}\setminus\{t_1,\dots,t_n\}$ where $t_1,\dots,t_n$ are roots of $\operatorname{det}{f(t)}=0$, is my thinking was correct? Could anyone tell me the solution? Lots of ram. How to use it? My PC has 8 Gb of ram. Is there any way to make ubuntu use most of it? I mean rarely drop caches and keep once opened programms in ram longer, preload apps on boot, etc. Merge flash site into one executable Notification email from stackoverflow contains "<3" after zip code "Welcome to emergency mode!" Think it is a fsck problem In the simple linear regression case $y=\beta_0+\beta_1x$, you can derive the least square estimator $\hat\beta_1=\frac{\sum(x_i-\bar x)(y_i-\bar y)}{\sum(x_i-\bar x)^2}$ such that you don't have to know $\hat\beta_0$ to estimate $\hat\beta_1$  Suppose I have $y=\beta_1x_1+\beta_2x_2$, how do I derive $\hat\beta_1$ without estimating $\hat\beta_2$? or is this not possible? What causes the permittivity and permeability of vacuum? When light travels through a material, it gets "slowed down" (at least its net speed decreases).  The atoms in the material "disturb" the light in some way which causes it to make stops on its path.  This is expressed in the material's permittivity and permeability:  Its ability to transmit electromagnetic waves.  But then what causes the limited permittivity and permeability of vacuum?  There are no atoms there to disturb the light, so what is keeping it from travelling at infinite speed?  Is there a special property of space itself which determines the speed of light?  Or is it the virtual particles in vacuum which interact with the light?