Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

How to Make Sure You Have Good Passwords Expand / Collapse
Author
Message
Posted Monday, February 23, 2004 5:15 PM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Friday, November 9, 2012 5:47 PM
Points: 230, Visits: 18
Comments posted to this topic are about the content posted at http://www.sqlservercentral.com/columnists/


robbac
___the truth is out there___
Post #101851
Posted Tuesday, March 2, 2004 6:53 AM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Yesterday @ 10:52 AM
Points: 295, Visits: 277

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
Post #103533
Posted Tuesday, March 2, 2004 7:01 AM
SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: Moderators
Last Login: 2 days ago @ 8:57 AM
Points: 8,369, Visits: 736
Don't forget sp_change_user_login


Post #103538
Posted Tuesday, March 2, 2004 7:31 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, August 21, 2014 9:46 AM
Points: 2,604, Visits: 785

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'.




Post #103550
Posted Wednesday, March 3, 2004 7:55 AM
SSCrazy Eights

SSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy EightsSSCrazy Eights

Group: Moderators
Last Login: 2 days ago @ 8:57 AM
Points: 8,369, Visits: 736

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.




Post #103875
Posted Wednesday, March 2, 2005 12:00 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Monday, April 28, 2014 6:11 AM
Points: 223, Visits: 139

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.




Post #164893
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse