Re: Application Roles ENCRYPT function Valid Password Characters
From: Chuck Hawkins (charles.hawkins_at_NOSPAMjenzabar.net)
Date: 06/29/05
- Next message: Chuck Hawkins: "Re: Application Roles ENCRYPT function Valid Password Characters"
- Previous message: Chuck Hawkins: "Re: Application Roles ENCRYPT function Valid Password Characters"
- In reply to: Sue Hoegemeier: "Re: Application Roles ENCRYPT function Valid Password Characters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Date: Wed, 29 Jun 2005 08:06:00 -0400
Incidentally, here is the ugly password generation code:
set nocount on
declare @counter int,
@password varchar(128),
@char char(1),
@charindex int,
@loop int
/* Unallowed characters:
! = 33
( = 40
) = 41
, = 40
* = 42
; = 59
? = 63
@ = 64
[ = 91
] = 93
{ = 123
} = 125
*/
select @counter = 1, @password = ''
while @counter < 2
begin
--Restrict the password to 0-9, A-Z, and a-z
select @loop = 1
while @loop = 1
begin
select @charindex = convert(int, rand() * 254)
if (@charindex between 65 and 90 or @charindex between 97 and 122)
and @charindex not in (33,40,41,42,59,63,64,91,93,123,125)
--or @charindex between 161 and 255 or @charindex between 130 AND 140
select @loop = 0
end
--Accumulate characters for password string
select @char = char(@charindex)
select @password = @password + @char
select @counter = @counter + 1
end
while @counter < 4
begin
--Restrict the password to 0-9, A-Z, and a-z
select @loop = 1
while @loop = 1
begin
select @charindex = convert(int, rand() * 254)
if (@charindex between 48 and 57 or @charindex between 65 and 90 or
@charindex between 97 and 122)
and @charindex not in (33,40,41,42,59,63,64,91,93,123,125)
--or @charindex between 161 and 255 or @charindex between 130 AND 140
select @loop = 0
end
--Accumulate characters for password string
select @char = char(@charindex)
select @password = @password + @char
select @counter = @counter + 1
end
while @counter < 5
begin
--Restrict the password to 0-9
select @loop = 1
while @loop = 1
begin
select @charindex = convert(int, rand() * 254)
if @charindex between 48 and 57 --or @charindex between 65 and 90 or
@charindex between 97 and 122
and @charindex not in (33,40,41,42,59,63,64,91,93,123,125)
--or @charindex between 161 and 255 or @charindex between 130 AND 140
select @loop = 0
end
--Accumulate characters for password string
select @char = char(@charindex)
select @password = @password + @char
select @counter = @counter + 1
end
while @counter < 10
begin
-- Restrict the password to NOT 0-9, A-Z, and a-z
select @loop = 1
while @loop = 1
begin
select @charindex = convert(int, rand() * 254)
if --@charindex between 48 and 57 or @charindex between 65 and 90 or
@charindex between 97 and 122
--or
(@charindex between 161 and 255 or @charindex between 130 AND 140)
and @charindex not in (33,40,41,42,59,63,64,91,93,123,125)
select @loop = 0
end
--Accumulate characters for password string
select @char = char(@charindex)
select @password = @password + @char
select @counter = @counter + 1
end
while @counter < 11
begin
--Restrict the password to 0-9
select @loop = 1
while @loop = 1
begin
select @charindex = convert(int, rand() * 254)
if @charindex between 48 and 57 --or @charindex between 65 and 90 or
@charindex between 97 and 122
and @charindex not in (33,40,41,42,59,63,64,91,93,123,125)
--or @charindex between 161 and 255 or @charindex between 130 AND 140
select @loop = 0
end
--Accumulate characters for password string
select @char = char(@charindex)
select @password = @password + @char
select @counter = @counter + 1
end
while @counter < 129
begin
--Restrict the password to 0-9, A-Z, and a-z
select @loop = 1
while @loop = 1
begin
select @charindex = convert(int, rand() * 254)
if (@charindex between 48 and 57 or @charindex between 65 and 90 or
@charindex between 97 and 122
or @charindex between 161 and 255 or @charindex between 130 AND 140)
and @charindex not in (33,40,41,42,59,63,64,91,93,123,125)
select @loop = 0
end
--Accumulate characters for password string
select @char = char(@charindex)
select @password = @password + @char
select @counter = @counter + 1
end
select RTRIM(@password) AS Password
"Sue Hoegemeier" <Sue_H@nomail.please> wrote in message
news:99a4c1p6996f5mklnjbq0hhmapjunkv95u@4ax.com...
> You can find the valid characters in the books online help
> topic: Security Rules.
> You can find the topic in the index under passwords, rules
> for
>
> -Sue
>
> On Tue, 28 Jun 2005 15:49:06 -0400, "Chuck Hawkins"
> <charles.hawkins@NOSPAMjenzabar.net> wrote:
>
>>When I try to use the ODBC canonical ENCRYPT function for SP_SETAPPROLE, I
>>get an ODBC error when certain otherwise good characters are used in the
>>password. What characters are and are not allowed for passwords for
>>application roles while using the ENCRYPT function?
>>
>
- Next message: Chuck Hawkins: "Re: Application Roles ENCRYPT function Valid Password Characters"
- Previous message: Chuck Hawkins: "Re: Application Roles ENCRYPT function Valid Password Characters"
- In reply to: Sue Hoegemeier: "Re: Application Roles ENCRYPT function Valid Password Characters"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|