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. RNGCryptoServiceProvider rng = new RNGCryptoServiceProvider(); byte[] buff = new byte[size]; rng.GetBytes(buff); // Return a Base64 string representation … Read more

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 (BCrypt.checkpw(candidate_password, stored_hash)) System.out.println(“It matches”); else System.out.println(“It does not match”); These code snippets imply to me that the randomly generated salt is … Read more

ASP.NET Identity’s default Password Hasher – How does it work and is it secure?

I am wondering wether the Password Hasher that is default implemented in the UserManager that comes with MVC 5 and ASP.NET Identity Framework, is secure enough? And if so, if you could explain to me how it works? IPasswordHasher interface looks like this: public interface IPasswordHasher { string HashPassword(string password); PasswordVerificationResult VerifyHashedPassword(string hashedPassword, string providedPassword); … Read more

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 like to do it with .Net (2.0) functionality. What options … Read more

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 is password.setInputType(InputType.TYPE_TEXT_VARIATION_VISIBLE_PASSWORD); My problem is, when that CheckBox is unchecked it should again … Read more

SHA512 vs. Blowfish and Bcrypt [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for … Read more

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 += key.KeyChar; Console.Write(“*”); } else { Console.Write(“\b”); } } // Stops Receving Keys Once Enter is Pressed while (key.Key != ConsoleKey.Enter); Console.WriteLine(); Console.WriteLine(“The Password … Read more