passwords

Regex to validate password

这一生的挚爱 提交于 2019-12-01 22:23:41
I've looked on here for some ideas but I still seem to be struggling with coming up with a regular expression to meet my requirements. I need a regular expression to check a password format, the criteria are: At least 1 uppercase letter At least 1 number Only alphanumeric characters (no special characters) At least 8 characters long The regular expression I'm using is: ^(?=.*[a-z])(?=.*[A-Z])(?=.*\d).{8,}$ However this is also allowing characters like !$& . Is there a modification I need to make to this to get it to stop these special characters being accepted? Change the last part .{8,} to [a

IE7 regex issue - Regex that work in every browser does not work in ie7

允我心安 提交于 2019-12-01 18:38:08
I have a regex validating a password value to be > 6 < 25 characters with at least one number. var passwordRegEx = /^(?=.*\d)(?=.*[a-zA-Z]).{6,25}$/; if(!#quickRegister_Password').val().test(pass)) { errorMgs += 'Your password must be at least 6 characters and have at least 1 number and 1 letter.\r\n'; } It works in Firefox, Chrome, IE8 (IE7 ran from compatability in IE8) but not IE7 standalone. I think you have run into the regular expression lookahead bug in IE7's javascript engine. Run the tests on this page and see if your results match up; you will probably see the lookahead tests fail:

How can I vendorize bcrypt in a PHP application (and should I)?

99封情书 提交于 2019-12-01 17:36:10
I am contributing to a relatively mature open-source PHP project. Recently, I discovered that it stores passwords as plain MD5 hashes, which is quite bothersome to me. I figured that if I was going to fix it, I might as well Do It Right(tm), so I wanted to use bcrypt. First, what I have found for other languages: bcrypt-ruby appears to use either the original C code from OpenBSD or jBCrypt 's java code. py-bcrypt is a thin wrapper around the BSD code. BCrypt.net is a direct port of jBCrypt . Now, PHP itself supports bcrypt (albeit, misleadingly called simply 'blowfish') in the crypt function .

How to mask a password in Java 5?

本小妞迷上赌 提交于 2019-12-01 16:53:39
I am trying to mask a password in Java. Sun java has suggested a way to mask a password as follows. Masking a password It uses a simple way to do that. public void run () { stop = true; while (stop) { System.out.print("\010*"); try { Thread.currentThread().sleep(1); } catch(InterruptedException ie) { ie.printStackTrace(); } } } But this approach has several drawbacks. If the user uses the arrow keys + delete keys the password gets revealed. If the user accidentally press 2 keys at the same time (Extremely high typing speed) some characters does not get masked. Do you guys think of any way that

How can I vendorize bcrypt in a PHP application (and should I)?

拜拜、爱过 提交于 2019-12-01 16:49:22
问题 I am contributing to a relatively mature open-source PHP project. Recently, I discovered that it stores passwords as plain MD5 hashes, which is quite bothersome to me. I figured that if I was going to fix it, I might as well Do It Right(tm), so I wanted to use bcrypt. First, what I have found for other languages: bcrypt-ruby appears to use either the original C code from OpenBSD or jBCrypt's java code. py-bcrypt is a thin wrapper around the BSD code. BCrypt.net is a direct port of jBCrypt.

Django: built-in password reset views

a 夏天 提交于 2019-12-01 16:11:12
I am following the documentation and I am getting a NoReverseMatch error when I click on the page to restart my password. NoReverseMatch at /resetpassword/ Reverse for 'password_reset_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] urls.py: (r'^resetpassword/passwordsent/$', 'django.contrib.auth.views.password_reset_done'), (r'^resetpassword/$', 'django.contrib.auth.views.password_reset', name="reset_password"), (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P<token>,+)/$', 'django.contrib.auth.views.password_reset_confirm'), (r'^reset/done/$', 'django.contrib.auth

p:password doesn't redisplay prefilled model value

£可爱£侵袭症+ 提交于 2019-12-01 15:25:24
问题 i have my managed bean like this : @ManagedBean @SessionScoped public class utilisateur implements Serializable { private String login ="yous" ; private String password ="yous"; ... ... } and my login.xhtml <h:outputText value="login: " /> <p:inputText value="#{utilisateur.login}" /> <h:outputText value="password: " /> <p:password value="#{utilisateur.password}" /> so with this configuration the password must be shown by default like **** (yous) in p:password but it shows empty. 回答1: This is

Django: built-in password reset views

血红的双手。 提交于 2019-12-01 15:13:51
问题 I am following the documentation and I am getting a NoReverseMatch error when I click on the page to restart my password. NoReverseMatch at /resetpassword/ Reverse for 'password_reset_done' with arguments '()' and keyword arguments '{}' not found. 0 pattern(s) tried: [] urls.py: (r'^resetpassword/passwordsent/$', 'django.contrib.auth.views.password_reset_done'), (r'^resetpassword/$', 'django.contrib.auth.views.password_reset', name="reset_password"), (r'^reset/(?P<uidb36>[0-9A-Za-z]+)-(?P

How do I make Git ask for a username and password every time I push?

时光总嘲笑我的痴心妄想 提交于 2019-12-01 15:11:47
Where I work many people use the same computer on the same account. We now use the shell instead of the GUI just for convenience. The first time someone committed it asked for their username and password, but after that just used their account for all commits. I'm sorry that I don't know much about the shell, but this is the first time I'm using it. The commands I use to commit and synchronise are: git commit -a git push origin [branch name here] mu 無 It seems that users credentials are being cached. Go to your project, open .git/config and remove the lines: [credential] helper = store # or

How to mask a password in Java 5?

限于喜欢 提交于 2019-12-01 15:00:49
问题 I am trying to mask a password in Java. Sun java has suggested a way to mask a password as follows. Masking a password It uses a simple way to do that. public void run () { stop = true; while (stop) { System.out.print("\010*"); try { Thread.currentThread().sleep(1); } catch(InterruptedException ie) { ie.printStackTrace(); } } } But this approach has several drawbacks. If the user uses the arrow keys + delete keys the password gets revealed. If the user accidentally press 2 keys at the same