SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


How to Make Sure You Have Good Passwords


How to Make Sure You Have Good Passwords

Author
Message
Robbac
Robbac
Old Hand
Old Hand (328 reputation)Old Hand (328 reputation)Old Hand (328 reputation)Old Hand (328 reputation)Old Hand (328 reputation)Old Hand (328 reputation)Old Hand (328 reputation)Old Hand (328 reputation)

Group: General Forum Members
Points: 328 Visits: 18
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/


robbac
___the truth is out there___
Tatsu
Tatsu
SSCommitted
SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)SSCommitted (1.6K reputation)

Group: General Forum Members
Points: 1644 Visits: 307

Great article!

Here are a couple ways to check to make sure there is a mix of upper and lower case letters.

Use the LOWER function. This only ensures that there is at least one upper case character. Use like this:

if @password = LOWER (@password)
-- Password has no upper-case characters

If you want to count how many of each character type, include this in your function/procedure (Assumes a string variable @password is passed in):

declare @lowerCount int
declare @upperCount int
declare @numberCount int
declare @specialCount int
declare @currentIndex int
declare @currentCharAscii int

set @currrentIndex = 0
while @currIndex < LEN (@password)
begin
@currentCharAscii = ASCII (SUBSTRING (@password, @currentIndex, 1))
if @currentCharAscii between 97 and 122 set @lowerCount = @lowerCount + 1
if @currentCharAscii between 65 and 90 set @upperCount = @upperCount + 1
if @currentCharAscii between 48 and 57 set @numberCount = @numberCount + 1
end

set @specialCount = LEN (@password) - @lowerCount - @upperCount - @numberCount

-- Check your rules

You might need to debug typing errors in the code snippet since I did not actually write it in QA (I don't have SQL Server tools on this computer) but the logic should be right.



Bryant E. Byrd, BSSE MCDBA MCAD
Business Intelligence Administrator
MSBI Administration Blog
Antares686
Antares686
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: Moderators
Points: 27053 Visits: 795
Don't forget sp_change_user_login



MattieNH
MattieNH
Hall of Fame
Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)Hall of Fame (3.8K reputation)

Group: General Forum Members
Points: 3771 Visits: 901

I understand why passwords need to be difficult to figure out. I also understand that making passwords complex makes them more difficult to figure out programmatically. The dilemma I have with complex passwords (and non-complex passwords that have to be changed every month or so), is that the minute you (and everyone else who wants their site passwords to be secure) start requiring these type of passwords, users have no choice but to write them down somewhere.

So I thought this article was very helpful given the premise that passwords need to be complex. I would, however, like to see an article that addresses how to keep passwords secure when they're kept in a folder, or an Excel spreadsheet, or an Outlook folder called 'my passwords'.





Antares686
Antares686
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: Moderators
Points: 27053 Visits: 795

After further thought and reviewing your code I realized you left one area out that should be addressed.

You check to make sure password and login don't match but you should make sure the login does not exist in the password.

For instance it is consider a weak password if I do something like so.

Login: BobSmtih

Password: BobSmith123

Use Charindex to look for bobsmith in the password string and if return > 0 it was found, password is bad.

Just a suggestion.





jtango
jtango
SSC Veteran
SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)SSC Veteran (285 reputation)

Group: General Forum Members
Points: 285 Visits: 156

As I said in some reply to a password issue on this forum earlier, strong passwords are at least 15 characters long and it doesn't matter much if there are uppercase and lowercase letters and special characters mixed. Putting special characters in the middle of password may give you some edge for your monitoring software to discover attackers while the password problem is more complex for software like Bruteforce.

To my knowledge the cheapest software (freeware) give up the pasword cracking task when password length is 14 chars long and to be on the safe side use always at least 15 characters with passwords.

The "easy to remember password requirements" chapter is good when the length is raised to 15 chars and one should use a password sentence instead of a password.

By the way this is a very good password for sa :

DECLARE @pass char(72)

SELECT @pass=convert(char(36),newid())+convert(char(36),newid())

EXECUTE master..sp_password null,@pass,'sa'

GO

Why..? Well, where do you need sa's password, nowhere.

Don't work easy, work safe.





Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search