Read up on security through minority.
Then, once you have realized how silly it is to try to reinvent the wheel by out-smartening ones designed by cryptography geniuses;
Look at the preexisting algorithms available for you.
More specifically crypt(sha512) or bcrypt().