salt

How can I hash passwords in postgresql?

旧街凉风 提交于 2019-11-27 10:29:45
I need to hash some passwords with salt on postgresql, and I haven't been able to find any relevant documentation on how to get that done. So how can I hash passwords (with some salts) in postgresql? It's been a while since I asked this question, and I'm much more familiar with the cryptographic theory now, so here is the more modern approach: Reasoning Don't use md5. Don't use a single cycle of sha-family quick hashes. Quick hashes help attackers, so you don't want that. Use a resource-intensive hash, like bcrypt, instead. Bcrypt is time tested and scales up to be future-proof-able. Don't

Do I need a “random salt” once per password or only once per database?

大城市里の小女人 提交于 2019-11-27 10:28:15
Further to my previous question about salted passwords in PHP/MySQL , I have another question regarding salts. When someone says "use a random salt" to pre/append to a password, does this mean: Creating a static a 1 time randomly generated string of characters , or Creating a string of characters that changes at random every time a password is created ? If the salt is random for every user and stored along with the hashed password, how is the original salt ever retrieved back for verification? Rich Adams A new salt should be randomly generated for each user and each time they change their

Is time() a good salt?

 ̄綄美尐妖づ 提交于 2019-11-27 10:23:36
I'm looking at some code that I have not written myself. The code tries to hash a password with SHA512 and uses just time() as the salt. Is time() too simple a salt for this or is this code safe? Thanks for the answers and comments. I will sum it up here for the new readers: salt should be different for each user, so if 2 users register at the same time, their salts won't be unique. This is a problem, but not a big one. but salt shouldn't be in any way related to the user, so time() is not a good salt. " Use a random, evenly distributed, high entropy salt. " -- That's a mouthful, so what code

Can you help me to understand salt hashing function?

爱⌒轻易说出口 提交于 2019-11-27 07:18:17
问题 I am going through various password hashing techniques and I found a tutorial which left me a bit dubious about some points. In particular, I just would like if you could reconfirm/explain a few things.For example i found the following function. Now if I understand well what this is doing, it's generating a salt which in case with the following values: $salt = sprintf("$2a$%02d$", $cost) . $salt; // if $cost = 10 and $salt 234, then it should output $2a$1002d$234? Secondly, the example for

How do I generate a SALT in Java for Salted-Hash?

∥☆過路亽.° 提交于 2019-11-27 06:04:00
I've been looking around and the closest answer is : How to generate a random alpha-numeric string? I want to follow this workflow according to this CrackStation tutorial : To Store a Password Generate a long random salt using a CSPRNG. Prepend the salt to the password and hash it with a standard cryptographic hash function such as SHA256. Save both the salt and the hash in the user's database record. To Validate a Password Retrieve the user's salt and hash from the database. Prepend the salt to the given password and hash it using the same hash function. Compare the hash of the given password

How to create a asp.net membership provider hashed password manually?

纵然是瞬间 提交于 2019-11-27 05:37:53
问题 I'm using a website as a frontend and all users are authenticated with the standard ASP.NET Membership-Provider. Passwords are saved "hashed" within a SQL-Database. Now I want to write a desktop-client with administrative functions. Among other things there should be a method to reset a users password. I can access the database with the saved membership-data, but how can I manually create the password-salt and -hash? Using the System.Web.Membership Namespace seems to be inappropriate so I

How to use PKCS5_PBKDF2_HMAC_SHA1()

陌路散爱 提交于 2019-11-27 05:34:10
问题 I am trying to use PKCS5_PBKDF2_HMAC_SHA1() and below is my sample program. I wanted to make sure if my result of PKCS5_PBKDF2_HMAC_SHA1() is correct so I verified the same with the website http://anandam.name/pbkdf2/ and I see a different result. Am I using the API correctly? I am having doubts if I am passing salt value correctly. I have pasted my result and website result after the program. Please help me understand this. #include <stdio.h> #include <types.h> #include <string.h> #include

runtime loading of ValidateAntiForgeryToken Salt value

霸气de小男生 提交于 2019-11-27 04:44:05
问题 Consider an ASP.NET MVC application using the Salt parameter in the [ValidateAntiForgeryToken] directive. The scenario is such that the app will be used by many customers. It's not terribly desirable to have the Salt known at compile time. The current strategy is to locate the Salt value in the web.config. [ValidateAntiForgeryToken(Salt = Config.AppSalt)] //Config.AppSalt is a static property that reads the web.config. This leads to a compile-time exception suggesting that the Salt must be a

Why does BCrypt.net GenerateSalt(31) return straight away?

五迷三道 提交于 2019-11-27 01:33:10
问题 I stumbled across BCrypt.net after reading Jeff Atwood's post about storing passwords which led me to Thomas Ptacek's recommendation to use BCrypt to store passwords. Which finally led me to this C# implementation of BCrypt In the comments on the last link above someone asked "Why do GenerateSalt(30) take for ever, but GenerateSalt(31) seems to take no time at all?" I ran BCrypt.HashPassword(password, BCrypt.GenerateSalt(31)) and got my result in 0 milliseconds. I've been running BCrypt

How long to brute force a salted SHA-512 hash? (salt provided)

天涯浪子 提交于 2019-11-26 23:47:28
Here is an algorithm in Java: public String getHash(String password, String salt) throws Exception { String input = password + salt; MessageDigest md = MessageDigest.getInstance(SHA-512); byte[] out = md.digest(input.getBytes()); return HexEncoder.toHex(out); } Assume the salt is known. I want to know the time to brute force for when the password is a dictionary word and also when it is not a dictionary word. emboss In your case, breaking the hash algorithm is equivalent to finding a collision in the hash algorithm. That means you don't need to find the password itself (which would be a