Questions tagged [passwords]

Passwords are primarily used as a way of accessing information and also limiting the number of users who can get access to a machine. It is primarily used with a username for the authorization system. Sometimes people use keys instead of passwords due to the increased strength of the keys.

Passwords or Pass Phrases are a that is used to help lockout people who do not know this string from using a persons account or computer. They have almost always been used since computers were first connected with each other as a way of making sure that each user had the ability to know that their account on the computer or network was not going to be taken over by a peer worker who had something against them. It also makes sure that only the person who knows a person's user-name and password can get into their account and change things that they have access to.

On websites and other web-based services passwords are used to make sure that anyone trying to connect to the site or service is who they say they are. In addition to a user-name which may be a another string or the person's email, it makes the server that the person who is trying to login(gain authorization to the site or service) more likely to trust them and allow them to gain access to it.

Storing a password should never be done in plain text, this means that the passwords are stored exactly as they were typed by the user. You should use a functions that are is available in almost every web programming language, and thus is the best way to store a users password since it uses one-way encryption which means that no one can get the password back without first attempting to guess it repeatedly, also known as "bruteforcing".

alone still discloses that the two passwords are the same (as they would have the same hash value). To avoid this, a known random string (salt) can be hashed together. Salt can be stored openly (next to the hashed value) as it is not a password, just makes the password hash-code different.

It is still better to protect such table as much as possible as (assuming the hashing algorithm is known) the attacker can use it with his own program to probe a big number of potential passwords in a short time. Probing the real system is much more difficult as it usually locks or at least forces delay after multiple failed attempts.

A big proportion of currently use passwords are insecure and can be relatively easily guessed (empty, same as username, date of birth, etc). Another problem is that users often use the same password for different sites or applications.

9952 questions
260
votes
18 answers

Password hint font in Android

When an EditText is in password mode, it seems that the hint is shown in a different font (courrier?). How can I avoid this? I would like the hint to appear in the same font that when the EditText is not in password mode. My current xml:
hpique
  • 112,774
  • 126
  • 328
  • 461
249
votes
27 answers

Generating Random Passwords

When a user on our site loses his password and heads off to the Lost Password page we need to give him a new temporary password. I don't really mind how random this is, or if it matches all the "needed" strong password rules, all I want to do is…
FryHard
  • 9,690
  • 7
  • 32
  • 37
242
votes
24 answers

Setting the MySQL root user password on OS X

I just installed MySQL on Mac OS X. The next step was setting the root user password, so I did this next: Launch the terminal app to access the Unix command line. Under the Unix prompt I executed these commands: $ cd /usr/local/mysql/bin $…
madaura
  • 2,421
  • 3
  • 12
  • 3
242
votes
8 answers

What is the best practice for dealing with passwords in git repositories?

I've got a little Bash script that I use to access twitter and pop up a Growl notification in certain situations. What's the best way to handle storing my password with the script? I would like to commit this script to the git repo and make it…
kubi
  • 44,308
  • 19
  • 90
  • 118
226
votes
5 answers

SHA512 vs. Blowfish and Bcrypt

I'm looking at hashing algorithms, but couldn't find an answer. Bcrypt uses Blowfish Blowfish is better than MD5 Q: but is Blowfish better than SHA512? Thanks.. Update: I want to clarify that I understand the difference between hashing and…
Chris
  • 8,306
  • 16
  • 43
  • 56
219
votes
17 answers

Password masking console application

I tried the following code... string pass = ""; Console.Write("Enter your password: "); ConsoleKeyInfo key; do { key = Console.ReadKey(true); // Backspace Should Not Work if (key.Key != ConsoleKey.Backspace) { pass +=…
Mohammad Nadeem
  • 8,364
  • 11
  • 51
  • 79
206
votes
24 answers

Generating a random password in php

I am trying to generate a random password in php. However I am getting all 'a's and the return type is of type array and I would like it to be a string. Any ideas on how to correct the code? Thanks. function randomPassword() { $alphabet =…
nunos
  • 17,808
  • 47
  • 112
  • 148
206
votes
11 answers

How to provide user name and password when connecting to a network share

When connecting to a network share for which the current user (in my case, a network enabled service user) has no rights, name and password have to be provided. I know how to do this with Win32 functions (the WNet* family from mpr.dll), but would…
gyrolf
  • 3,552
  • 5
  • 24
  • 22
202
votes
22 answers

Programmatically change input type of the EditText from PASSWORD to NORMAL & vice versa

In my application, I have an EditText whose default input type is set to android:inputType="textPassword" by default. It has a CheckBox to its right, which is when checked, changes the input type of that EditText to NORMAL PLAIN TEXT. Code for that…
Rajkiran
  • 14,425
  • 24
  • 69
  • 108
200
votes
19 answers

Your password does not satisfy the current policy requirements

I want to create a new user in mysql with syntax: create user 'demo'@'localhost' identified by 'password'; But it returns an error: Your password does not satisfy the current policy requirements. I have tried many passwords but they don't work.…
Nguyen
  • 2,011
  • 2
  • 7
  • 4
200
votes
35 answers

How to switch between hide and view password

Is there a clever way to let the user switch between hide and view password in an android EditText? A number of PC based apps let the user do this.
jacknad
  • 12,453
  • 38
  • 115
  • 190
194
votes
1 answer

Do I need to store the salt with bcrypt?

bCrypt's javadoc has this code for how to encrypt a password: String pw_hash = BCrypt.hashpw(plain_password, BCrypt.gensalt()); To check whether a plaintext password matches one that has been hashed previously, use the checkpw method: if…
RodeoClown
  • 12,312
  • 12
  • 49
  • 56
187
votes
14 answers

Hash and salt passwords in C#

I was just going through one of DavidHayden's articles on Hashing User Passwords. Really I can't get what he is trying to achieve. Here is his code: private static string CreateSalt(int size) { //Generate a cryptographic random number. …
ACP
  • 32,884
  • 96
  • 217
  • 360
184
votes
12 answers

How can I hash a password in Java?

I need to hash passwords for storage in a database. How can I do this in Java? I was hoping to take the plain text password, add a random salt, then store the salt and the hashed password in the database. Then when a user wanted to log in, I could…
Chris Dutrow
  • 42,732
  • 59
  • 174
  • 243
184
votes
2 answers

Read password from stdin

Scenario: An interactive CLI Python program, that is in need for a password. That means also, there's no GUI solution possible. In bash I could get a password read in without re-prompting it on screen via read -s Is there something similar for…
Boldewyn
  • 75,918
  • 43
  • 139
  • 205