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

Full Control Over a Randomly Generated Password Expand / Collapse
Author
Message
Posted Tuesday, February 20, 2007 5:41 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 3:07 PM
Points: 2,382, Visits: 3,369
Comments posted here are about the content posted at http://www.sqlservercentral.com/columnists/plarsson/2878.asp


N 56°04'39.16"
E 12°55'05.25"
Post #346214
Posted Tuesday, April 24, 2007 10:54 PM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Thursday, February 06, 2014 12:59 PM
Points: 801, Visits: 1,962

Very good!

One problem though.  Your code to limit the password length does not work if I pass negative numbers.  When the specs are negative then they can't be more negative ten the number of items in the list.  You can't call for more than 26 non-duplicated upper case letters as there are only 26 of them.



ATB

Charles Kincaid

Post #360739
Posted Wednesday, April 25, 2007 1:00 AM
SSC Journeyman

SSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC JourneymanSSC Journeyman

Group: General Forum Members
Last Login: Monday, January 06, 2014 2:10 PM
Points: 96, Visits: 67

Hi,

I always think that when ever i find some time spare than i will write this one.But u did and did in a nice way

Post #360745
Posted Wednesday, April 25, 2007 2:48 AM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Wednesday, April 09, 2014 11:34 PM
Points: 6,996, Visits: 8,409

Nice solution.

I've been using spc_random_password of Written by Narayana Vyas Kondreddi http://vyaskn.tripod.com  (Stored procedure to generate a simple or complex random password from almost when it was published (2001).



Johan


Don't drive faster than your guardian angel can fly ...
but keeping both feet on the ground won't get you anywhere

- How to post Performance Problems
- How to post data/code to get the best help


- How to prevent a sore throat after hours of presenting ppt ?


"press F1 for solution", "press shift+F1 for urgent solution"


Need a bit of Powershell? How about this

Who am I ? Sometimes this is me but most of the time this is me
Post #360762
Posted Wednesday, April 25, 2007 4:45 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Thursday, November 19, 2009 11:49 AM
Points: 3, Visits: 3
Well, its a nice solution and working prefect.
Post #360779
Posted Wednesday, April 25, 2007 5:55 AM
SSC-Enthusiastic

SSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-EnthusiasticSSC-Enthusiastic

Group: General Forum Members
Last Login: Saturday, March 29, 2014 8:01 PM
Points: 132, Visits: 105
A thought for generating passwords non-randomly: use your birthday in the Jewish (or Muslim or Persian or whatever) calendar. Therefore, if you forget it for whatever reason, you can regenerate it from a web site.
Post #360793
Posted Wednesday, April 25, 2007 6:20 AM


SSC Eights!

SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!SSC Eights!

Group: General Forum Members
Last Login: Tuesday, August 10, 2010 4:54 AM
Points: 815, Visits: 32

This is a great idea, I am going to use it in my application. I have re-written it as a function though  (for consistency with standards of my system) by creating a view for the NEWID() function:

CREATE VIEW v_NewID AS SELECT NEWID() AS 'New_ID'

and modifying the code to use the view rather than NEWID()

eg:

-- Get the Number Items
SET @i = ABS(@NumberItems)
WHILE @i > 0 AND LEN(@Numbers) > 0   
  SELECT @v = ABS(CAST(CAST(New_ID AS BINARY(16)) AS BIGINT)) % LEN(@Numbers) + 1
  ,    @c = SUBSTRING(@Numbers, @v, 1)
  ,    @Numbers = CASE
       WHEN @NumberItems < 0
     THEN STUFF(@Numbers, @v, 1, '')
   ELSE @Numbers
  END
  ,    @Temp = @Temp + @c
  ,    @i = @i - 1
FROM v_NewID

David



If it ain't broke, don't fix it...
Post #360799
Posted Wednesday, April 25, 2007 6:48 AM
SSC Rookie

SSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC RookieSSC Rookie

Group: General Forum Members
Last Login: Thursday, March 20, 2008 2:08 PM
Points: 48, Visits: 3

Nice job, I’ll use it for sure.

I was using, since always, Left 4 of a new guid + Left 4 of a new guid (uppercase)

Kind of…

 

Thanks




Best Regards,

David, MCAD.NET

Post #360811
Posted Thursday, April 26, 2007 8:20 AM
Hall of Fame

Hall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of FameHall of Fame

Group: General Forum Members
Last Login: 2 days ago @ 7:01 PM
Points: 3,081, Visits: 11,229

This link below has my own procedure for generating a somewhat mnemonic password, as well as several others for generating random or semi-random passwords:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=78859

It is an interesting problem, because of the conflicting requirements of security where long, random passwords are better, and the ability of a human to read, remember, and type the password.  A password like B4zI1=5UhW4K6KM'3 is probably almost impossible to crack, but how many people can remember it and type it correctly?

My mnemonic password procedure is an attempt at a compromise solution to generate passwords that are both secure and something that a human can remember and use.  It could be done better, but it was the best solution I could think of at the time to meet my requirements.


 

Post #361157
Posted Thursday, April 26, 2007 11:48 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: 2 days ago @ 3:07 PM
Points: 2,382, Visits: 3,369

It doesn't matter.

When you want non-duplicated characters from a group, the while loop exits when there are no more characters to choose from.

Even if you set 50 non-duplicated characters, the while loop exits after 26.

 




N 56°04'39.16"
E 12°55'05.25"
Post #361438
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse