salt

How to use PKCS5_PBKDF2_HMAC_SHA1()

天大地大妈咪最大 提交于 2019-11-28 05:32:35
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 <stdio.h> #include <stdlib.h> #include <malloc.h> #include <openssl/hmac.h> #include <openssl/evp.h>

Crypt() salt generation and password encryption, well executed?

让人想犯罪 __ 提交于 2019-11-28 04:33:42
问题 these are some functions I am using for password encryption and password verification. Was wondering if this is a good way to handle it. I am using the codeigniter framework. This is the function to 'encrypt' : function crypt_pass( $input ){ $salt = substr(sha1(date('r')), rand(0, 17), 22); $cost = 10; $hash = '$2y$' . $cost . '$' . $salt; $pw_and_salt['pw'] = crypt($input, "$hash"); $pw_and_salt['salt'] = $salt; return $pw_and_salt; } I store both the password and the salt in my DB. Here is

runtime loading of ValidateAntiForgeryToken Salt value

与世无争的帅哥 提交于 2019-11-28 00:31: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 const at compile time. An attribute argument must be a constant expression, typeof expression or array

WebMatrix WebSecurity PasswordSalt

浪尽此生 提交于 2019-11-27 23:27:11
I am using WebMatrix and have built a website based on the "StarterSite". In this starter site you get a nice basic layout - including registration, login, forgot password pages etc... I've noticed that in the database that the "webpages_Membership" table has a column named "PasswordSalt". After creating a few new user accounts, this column always remains blank. So I'm assuming that no password salt (not even a default one) is in use. Obviously this is not the best practice, however I cannot seem to find any documentation that tells me how to set or manage the password salt. How can I set the

What is the correct format for a blowfish salt using PHP's crypt?

我与影子孤独终老i 提交于 2019-11-27 19:29:51
I have read the information provided on the PHP Manual Entry for crypt() , but I find myself still unsure of the format for a salt to trigger the Blowfish algorithm. According manual entry, I should use '$2$' or '$2a$' as the start of a 16 character string. However, in the example given later, they use a much longer string: ' $2a$07$usesomesillystringforsalt$ ', which indicates to me that whatever string I provide will be sliced and diced to fit the model. The problem I am encountering is actually triggering the Blowfish algo vs STD_DES . Example: $foo = 'foo'; $salt = '$2a$' . hash('whirlpool

Salt and passwords [duplicate]

戏子无情 提交于 2019-11-27 15:43:16
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: Secure hash and salt for PHP passwords WARNING Don't use MD5 for passwords, use an alternative like bcrypt For my passwords should I use salt like this (the salt will be unique to each user and not stored directly with the password)... $salt = sha1(md5("coders gonna code")); $password = md5($salt.$password); or would it be okay if I just used: $password = md5($password); because if I used salt, even if the user

What is the purpose of salt?

依然范特西╮ 提交于 2019-11-27 14:19:24
问题 In a Linux system, passwords are stored using an MD5 hash. Why can the usage of "salt" protect the system more? Particularly, I want to make clear the following two The salt is said to be stored in clear text with the hash, then how it can prevent the attacker when the attacker knows the salt value. (Attacker can be the system administrator himself who can check /etc/shadow . If the salt is generated randomly everytime, how can the system compare the hash to authenticate the user? For example

What is the safest way to store a password using Code Igniter?

二次信任 提交于 2019-11-27 13:10:09
问题 I am using Code Igniter for my current project. As of now, I am using MD5 for password hashing, but I have read at a lot of places, that it is not a good practice to do so. What should I go with? Using a salt Or should I use bcrypt Also, if bcrypt is recommended, then how to use it with Code Igniter? EDIT I have put these files in application/libraries PasswordHash.php c/Makefile c/crypt_private.c In my controller, I am using this code - $params = array( 'phpass_hash_strength' => 8, 'phpass

How to generate a good salt - Is my function secure enough?

不问归期 提交于 2019-11-27 11:56:01
问题 Here's the function I'm using to generate random salts: function generateRandomString($nbLetters){ $randString=""; $charUniverse="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; for($i=0; $i<$nbLetters; $i++){ $randInt=rand(0,61); $randChar=$charUniverse[$randInt]; $randString=$randomString.$randChar; } return $randomString; } This is for a non commercial website. It's only used to generate the salt (to be stored in the db and used along with the user submitted pw for hashing

What is SALT and how do i use it?

霸气de小男生 提交于 2019-11-27 11:19:36
I have been searching around and I am still unsure of what a "salt" is and how to use/implement it. Sorry for the noobish question, I am self learning php. Approximately Linear I am definitely not an expert, but the really short answer is that "salting" a line of text means to stick a few extra characters on the end of it. You could salt "salt" with "abcdefg" to get "saltabcdefg". This might be useful if "salt" happens to be a password that you'd like to make more difficult to guess. Typically, the password+salt are transformed ('hashed') by some difficult-to-reverse process into a completely