password-protection

What is a good way to produce a random “site salt” to be used in creating password retrieval tokens?

筅森魡賤 提交于 2019-12-03 01:32:30
问题 I would like to create a site-wide hash to be used as salt in creating password retrieval tokens. I have been bouncing around stackoverflow trying to get a sense of the best way to do this. Here's the reset process: When a user requests a password reset email the code generates a retrieval token: $token = hash_hmac('sha256', $reset_hash* , $site_hash) *$reset_hash is a hash created using phpass HashPassword() function, saved in the user table. I then send the token in a URL to the users email

If I make the SALT random for each user, how do I authenticate them?

扶醉桌前 提交于 2019-12-03 01:31:33
I've been reading up on the benefits of salting and hashing passwords, but one thing still eludes me... When I provide a random salt for each user, how do I then know what the salt was when I try to authenticate them to login? so if I do.. HASHPW = PW.RANDOMNUMBER I could store the random number in the database, but that seems to kill the entire point of adding the salt.. doesn't it? I could also use a non random number for each salt, but then that also kills the point of the salt because if they figure it out they have all my users passwords... I just started learning PHP and MySQL and

Password Encryption: PBKDF2 (using sha512 x 1000) vs Bcrypt

巧了我就是萌 提交于 2019-12-03 01:23:25
问题 I've been reading about the Gawker incident and several articles have cropped up regarding only using bcrypt to hash passwords and I want to make sure my hashing mechanism is secure enough to avoid switching to another method. In my current application I have opted for a PBKDF2 implementation utilising sha2-512 and a minimum of 1000 iterations. Can I ask for opinions on using PBKDF2 vs Bcrypt and whether or not I should implement a change? 回答1: You're good with PBKDF2, no need to jump to

Password protect iPhone app

牧云@^-^@ 提交于 2019-12-03 01:15:43
问题 I'm starting a new app, and I'd like to know how to require a password to open it. I was considering a UIActionSheet in the application didFinishLaunchingWithOptions method of the app delegate implementation file, but am unsure how to go about doing so. I'm going to keep trying though. Found this video, which seems pretty helpeful. Now I've got my UIActionSheet to pop up displaying "Enter password," and am trying to figure how to add a keypad to the action sheet. 回答1: I think you may have

How to upgrade a password storage scheme (change hashing-algorithm)

人盡茶涼 提交于 2019-12-02 20:22:28
I've been asked to implement some changes/updates to an intranet-site; make it 'future proof' as they call it. We found that the passwords are hashed using the MD5 algorithm. (the system has been around since 2001 so it was adequate at time). We would now like to upgrade the hashing-algorithm to a stronger one (BCrypt-hash or SHA-256). We obviously do not know the plaintext-passwords and creating a new password for the userbase is not an option *) . So, my question is: What is the accepted way to change hashing-algorithm without having access to the plaintext passwords? The best solution would

Android: Encrypt password [duplicate]

十年热恋 提交于 2019-12-02 19:25:15
Possible Duplicate: Storing a password I am using shared preference to store password. Is it is secure to save the password data as it is, or i have to encrypt it before saving it. Please help me with sample code. Thanks in Advance, You should never save a password directly, instead save a hash of the password. Short answer: it's pretty secure. Long answer: first off, if you are creating an application that allows a user to log into a web / remote service, you might want to look into the AccountManager . It's a bit harder to learn the APIs and intergrate with it, but you get some nice benefits

Zipping a file using DotNetZip on C# on mac

浪子不回头ぞ 提交于 2019-12-02 18:22:37
问题 I am trying to zip a file or directory in C# using the following snippet of code on a mac that uses DotNetZip. But I get some exceptions below, what am I doing wrong? using Ionic.Zip; namespace CSLab { class Program { static void Main(string[] args) { using (ZipFile zip = new ZipFile()) { zip.Password = "password"; zip.AddDirectory("./test"); zip.Save("a.zip"); } } } } Unhandled Exception: System.ArgumentException: 'IBM437' is not a supported encoding name. For information on defining a

Log in screen on first start

柔情痞子 提交于 2019-12-02 17:51:53
问题 how would you create an activity that only runs when the application is started for the first time ever and provides the user with a screen to input a pin and "unlock" the application First time ever meaning when the application is first installed and started for the first time. As in the FIRST EVER time it is opened. 回答1: You can use android preferences for show login screen only for the first time. You can set flag in preference and check it when application start. 回答2: You can always start

Password protect iPhone app

自古美人都是妖i 提交于 2019-12-02 16:32:07
I'm starting a new app, and I'd like to know how to require a password to open it. I was considering a UIActionSheet in the application didFinishLaunchingWithOptions method of the app delegate implementation file, but am unsure how to go about doing so. I'm going to keep trying though. Found this video , which seems pretty helpeful. Now I've got my UIActionSheet to pop up displaying "Enter password," and am trying to figure how to add a keypad to the action sheet. pendor I think you may have better luck using a full UIViewController instance instead of a UIActionSheet . Adding keyboard

What is a good way to produce a random “site salt” to be used in creating password retrieval tokens?

混江龙づ霸主 提交于 2019-12-02 14:58:10
I would like to create a site-wide hash to be used as salt in creating password retrieval tokens. I have been bouncing around stackoverflow trying to get a sense of the best way to do this. Here's the reset process: When a user requests a password reset email the code generates a retrieval token: $token = hash_hmac('sha256', $reset_hash* , $site_hash) *$reset_hash is a hash created using phpass HashPassword() function, saved in the user table. I then send the token in a URL to the users email address. They click before the token times out in an hour. I match their submission with the a