I understand and recognize that storing passwords in my own database is a massive security hole compared to using services like Google or Facebook, but I was wondering if the following code could be used to securely store usernames and passwords using a salted hash:  $username = $_POST['user'] $salt = md5(openssl_random_psuedo_bytes(24, true)); $pass = sha1($salt.$_POST['pass'])   I believe it's fairly secure, but I'm no expert.  EDIT:  I think this would be better, would it?  $salt1 = md5(sha1(openssl_random_psuedo_bytes(32, true)); $pass = password_hash($_POST['pass'] . $salt1, PASSWORD_BCRYPT);   Am I any closer to finding a decent mechanism for storing passwords?
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:
Script to Notify me when something happens on a shared directory The situation is:  I have a shared directories from many other machines where other users work on.  I need to be notified whenever a user create, modify or delete a directory or file from his local directory which I share using smb...  It looks like the folder actions in the MAC systems..  Is there a software that do that?!  If there is no such application, any help in writing a script for that is appreciated..  Thanks in advanced... Writing string at the same position using Console.Write in C# 2.0 How to plot logistic regression decision boundary? Why isn't an upgrade to 20.04 from 18.04 available yet? Some packages, have a Provides: header. For example, the package postfix on Debian Wheezy has Provides: mail-transport-agent.   The package mail-transport-agent which doesn't exist physically is considered as a "virtual" package.   How can I know, on a Debian based system, if a given virtual package is "installed" (or "provided")? Can I list every "provided" virtual package?  Hint: to list every existing virtual package, installed or not, do: aptitude search "~v" Both  (if you take a list of values, the distribution of the most significant digit is rougly proportional to the logarithm of the digit) and  (given a corpus of natural language utterances, the frequency of any word is roughly inversely proportional to its rank in the frequency table) are not theorems in a mathematical sense, but they work quite good in the real life.   Does anyone have an idea why this happens?  (see also ) Showing that $f$ is linear function if $\forall z \in \mathbb{C}$, $|f(z)| \leq 1 + |z|$. Let $f$ be an entire function that satisfies $|f(z)| \leq 1 + |z|$ for all $z\in \mathbb{C}$. Show that $f(z) = az +b$ for fixed complex numbers $a,b$.    The hint tells us to try and use Cauchy's Integral Formula on an arbitrary circle.    This is my attempt: Consider an arbitrary large circle with centre $0$ and let $\Upsilon$ be the contour around this circle.    Then $$\int_{\Upsilon} \frac{f(z)}{z^{n+1}} \mathrm{d}z = \frac{2\pi i}{n!}f^{(n)}(0).$$    Note that $$\int_{\Upsilon}\frac{f(z)}{z^{n+1}} \leq \int_{\Upsilon}\left|\frac{f(z)}{z^{n+1}} \right|\leq \int_{\Upsilon} \frac{1}{|z^{n+1}|} + \frac{1}{|z|^n}$$ and the right hand side is $0$ by Cauchy's Integral Formula. I'm not sure if the first equality is valid, and not sure where to go from here. Add air resistance to projectile motion I am given an initial x and y position and initial velocity and I was asked to graph the trajectory in 1 second intervals.  This is what I have so far:  If $x_0 = 1, v_{0x} = 70, y_0 = 0, v_{0y} = 80, a_x = 0, a_y = -9.8$, and time will be 0,1,2,3... and so on.  Using these equations on every second you can find the plot will be a bell shaped with the highest point being ~ 325 m at about 600 seconds:   $$ x = x0 + (v_{0x})t + 1/2((a_x)t^2) $$ $$ y = y0 + (v_{0y})t + 1/2((a_y)t^2) $$  Usually in physics, we are taught in perfect condition with no air resistance. But what if there was air resistance? How would it affect this problem? How can i add it to my calculations and see what the difference is? So far, I didn't have the chance to use either of these services. Before starting, I would like to hear your opinions. What are the advantages and disadvantages? Why should I choose one over the other? I am mainly interested in the technical side, but I would also love to hear comments also regarding the plans and prices. On which Stack Exchange site can I ask questions like        When will [some new feature] for [some product] be released?   Where can I download an update for [some product]?   I'm getting errors when accessing the customer portal for [some company] – how can I fix this?   Why was I banned for doing [some action] on [some platform]?   Why is [some company] discontinuing [some product]?   Why is [some company] giving away [some product] for free?   What's the price for [some product]?      or any other product support/customer service questions?  It's not a product related to programming (or I've read  on Meta Stack Overflow) so I know Stack Overflow isn't the right place. Which other site in the network will take these kind of questions? This is the views section of the site analytics visible to 25k users on one of my sites:    That's, uh, not correct.  Our site has had its usual activity level during this time.  I checked a couple other sites, and the pattern is consistent.  This looks like a problem in the analytics data that's coming in; did Google change their API?  Update: Same site a week later; note that in addition to the brief spike of accuracy, page views have dropped to (near-)zero for the whole period, unlike the earlier report.  (I know this question has been closed as a dupe, but I thought having the two screen shots together might help somebody.) I just signed up, a day or two ago, and I've received a notification that there's something in my inbox.  Unfortunately, my email client isn't able to show me a link to my Inbox, or the message, because of the format of the email.  I normally use the email address that I gave when I signed up, just with MailWasher, which is intended to safely preview emails, as plain text, to decide whether or not to open them in a normal HTML email client.  I would be nice if that email contained a link to my inbox, which could be shown in MailWasher.  In order to collect that email in a normal email client, I'd also have to collect or delete all the other emails sent to that address.  I'm not entirely clear what's been done in that email to stop MailWasher seeing the link.  I can see a link to leave feedback, and one to unsubscribe, but not one to check my inbox.  Sure, I can live without one, but those emails would be a lot more useful to me if I could just click a link to go to my Inbox. Change running heads in longtable (or other "long table" package) How do you teleport a certain player to spawn after they win a 1v1 I managed a KitPvP server in Minecraft and everything works fine except when players wants to duel each other. They get sent to a room where they will be dueling. The main problem is when the winner wins, I have no idea how to teleport them back to spawn. Enable automatic deletion of old, unanswered, zero-score questions after a year? Related to Meta Super User efforts:  and Meta Server Fault efforts:  We already auto-remove negatively voted unanswered old questions automatically after 30 days, network wide, with no human intervention required. I was thinking we might extend that to remove old, unanswered zero score questions... based on the following criteria:  fewer than (question age in days * 1.5) views 0 score or lower, or 1 score or lower if the original author is deleted no answers 1 comment or fewer asked more than 1 year ago (thus based on creation date, not last activity date, so , or a user editing it, does not give a doomed question 365 more days of zombie &quot;life&quot;)  See the results of this query on:  (10509) |  (787) |  (650) This query has been refined based on the comments, and this is the final version that will roll out tonight. Every site in the network (except metas) will automatically delete old questions that meet this criteria from this point forward. boolean variable values in PHP to javascript implementation Foundational proof for Mersenne primes I know how to prove that, if $2^n-1$ is prime and $n&gt;1$, then $n$ is prime.  But how do we prove that, if $a^n-1$ is prime and $n&gt;1$, then $a$ must equal 2? Possible Duplicate:          Here is my sync script:  ssh user@remote.host /etc/init.d/some_service stop scp user@remote.host:/var/some_service/events ./events scp ./new_data user@remote.host:/var/some_service/new_data ssh user@remote.host /etc/init.d/some_service start   As You can see, it stops service, perform some copies with scp and starts service back.  The problem: it "costs" 4 "similar" ssh connections in a row.  Is there any way to make all the work, using one physical ssh connection? Do different databases use different name quote? For example, mysql quote table name using   SELECT * FROM `table_name`;   notice the `   Does other database ever use different char to quote their table name Is there any possibility to find my father's lost iPhone? My father has lost his iPhone 6 which was not signed in using an iCloud account. Is there any possibility it can be found?