passwords

Spring Security Encrypt MD5

ぃ、小莉子 提交于 2019-12-04 07:48:48
问题 I have a java web application using spring framework and spring security for its login. In my database I have my passwords encrypted to MD5 before being saved. I added in my application-config.xml this codes <security:authentication-provider> <security:password-encoder hash="md5"/> <security:jdbc-user-service data-source-ref="dataSource" users-by-username-query="select user_name username, user_password password, 1 enabled from users where user_name=?" authorities-by-username-query="select

Is there a built in function to hash passwords in .NET?

左心房为你撑大大i 提交于 2019-12-04 07:33:42
I seen this question Encrypting/Hashing plain text passwords in database and i am aware i shouldnt do md5("salt" + password); and i see an implementation in python for a solution. Is there a .NET built in function with params i can use instead of writing my own? Check out FormsAuthentication.HashPasswordForStoringInConfigFile string hashMD5 = FormsAuthentication.HashPasswordForStoringInConfigFile(Pass + Salt, "MD5"); string hashSHA1 = FormsAuthentication.HashPasswordForStoringInConfigFile(Pass + Salt, "SHA1"); I don't think there's a single function but you can do it in a few lines (here using

Node.js hashing of passwords

狂风中的少年 提交于 2019-12-04 07:28:48
问题 I am currently using the following for hashing passwords: var pass_shasum = crypto.createHash('sha256').update(req.body.password).digest('hex'); Could you please suggest improvements to make the project safer? 回答1: I use the follwing code to salt and hash passwords. var bcrypt = require('bcrypt'); exports.cryptPassword = function(password, callback) { bcrypt.genSalt(10, function(err, salt) { if (err) return callback(err); bcrypt.hash(password, salt, function(err, hash) { return callback(err,

How to change password using old password on parse android

橙三吉。 提交于 2019-12-04 07:20:13
I have an android app in which user can change his/her password my problem is how i can verify old password of user using parse i have 3 edit text "old password, new password and confirm new password". I search on parse.com but can't find any solution parse do not fetch data using get password. i am doing this String get_confrimpass=currentuser.getpassword(); if(get_confrimpass.replaceAll("\\s", "").equals(current_pass_check)) { } You can try logging them in using there current username and the password that they have given to you. If the loggin is successful the old password is correct. I.e

functions used to encrypt password in php?

岁酱吖の 提交于 2019-12-04 07:05:49
问题 I am programming a PHP site that allows users to register,I'm using codeigniter php and I want to know the best function to encrypt passwords and what difference between this function? 回答1: Passwords should almost never be encrypted. Instead, they should be one-way hashed. Generally, bcrypt is recommended, as it's resistant to brute forcing, where common alternatives like md5 or sha1 fail. 回答2: Use PHPass: http://www.openwall.com/phpass/ The preferred (most secure) hashing method supported by

Is this a good way to encrypt passwords with MD5?

旧城冷巷雨未停 提交于 2019-12-04 06:24:20
问题 I have never encrypted a password before, and this is what I came up with to do it, with the aid of this article. The article didn't include salt, so I had to figure it out myself: UTF8Encoding encoder = new UTF8Encoding(); byte[] salt = new byte[8]; new Random().NextBytes(salt); byte[] encodedPassword = encoder.GetBytes(txtPassword.Text); byte[] saltedPassword = new byte[8 + encodedPassword.Length]; System.Buffer.BlockCopy(salt, 0, saltedPassword, 0, 8); System.Buffer.BlockCopy

Regex for password policy [closed]

两盒软妹~` 提交于 2019-12-04 06:22:36
I need to enforce the following password policy : at least 9 characters, with at least one character from each of the 4 character classes (alphabetic lower and upper case; numeric, symbols). Any regex experts can help out here ? (I am using a Java regex engine) While we're at it, is there any online tool that can generate a regex for these kind of tasks ? Thanks ! (?=.{9,})(?=.*?[^\w\s])(?=.*?[0-9])(?=.*?[A-Z]).*?[a-z].* Note that this pattern doesn't include special utf chars like ö . I would not do this in one regex. I would split it and search for each thing, if you want to validate it.

How to obscure Scanner input text? [duplicate]

核能气质少年 提交于 2019-12-04 06:18:04
Possible Duplicate: Hide input on command line I'm making a password security checker program and my question is odd in that my program runs just fine. What I'm wondering is whether there is any way of making text entered to the console appear as it would in a password field. i.e the word entered will appear as "****" BEFORE the user presses the return key. I am aware that JFrame has a JPasswordField method but I don't think that helps me when in just using Scanner . Here is my code: import java.util.Scanner; public class SecurityCheckerMain { static String enteredPassword; public static void

Secure password reset without sending an e-mail

天涯浪子 提交于 2019-12-04 06:14:13
How do I go about implementing a secure password reset function without sending the user an e-mail? There is another secure bit of information that I store and only the user should know, but it seems insecure to just let the user update a password just because they know a 9 digit number. Note that user data is stored in a simple SQL table due to limitations on real database users on the server I'm working on. Any input would be appreciated. Update: After making an attempt at OpenID and remembering that this server doesn't allow PHP (and thus, cURL) to make any external requests, I tried

How to redirect data to a “getpass” like password input?

眉间皱痕 提交于 2019-12-04 06:09:24
I'm wring a python script for running some command. Some of those commands require user to input password, I did try to input data in their stdin, but it doesn't work, here is two simple python program represent the problem input.py import getpass print raw_input('text1:') print getpass.getpass('pass1:') print getpass.getpass('pass2:') put_data.py import subprocess import getpass def run(cmd, input=None): stdin=None if input: stdin=subprocess.PIPE p = subprocess.Popen(cmd, shell=True, stdin=stdin) p.communicate(input) if p.returncode: raise Exception('Failed to run command %r' % cmd) input =""