Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OpenCatalog method

Status
Not open for further replies.

GilMerc

IS-IT--Management
Nov 12, 2003
115
CA
Hi,

Is it possible to crypt a password (for userclass and bduser) when we use a method OpenCatalog.

Gilles.
 
You could create a variable, then populate the variable by reading the password from a secure file.

Pain is stress leaving the body

DoubleD
 
Hi Dave,

I try your Encrypt/decrypt function and the function don't works anytime. It seems like the string is too long then the function doesn't work.
Try your function with string : 11rrrrrrrrrrrrterwerwerwetwe

The function encrypt well the string but it doesn't decrypt the string that's encrypting before.

Gilles.
 
Sorry Gilles. I never wrote it to handle such a long password. I'm sure you could tweak the basic concept a little and get it to work.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
"Magic with Data"
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Effectively Dave, I found a solution. The problem was the transformation of value-128. I change the original tranformation by value+128 when it's under 0.

After test, it seems work. What do you think about this new code.

-------------------------
FUNCTION Mix (string1$,action$)
Dim Res$
Dim NxtChrVal%
Dim NxtChr$
Dim Stepper%
Dim cnt, x as integer
Res$ = ""
cnt = len(string1$)
Select Case action$
Case "E"
Stepper = 1
for x = 1 to cnt
NxtChrVal% = Asc(Mid(string1$,x,1))+(x*Stepper)
IF NxtChrVal% > 128 THEN NxtChrVal% = NxtChrVal% - 128

Res$ = Res$+Chr(NxtChrVal%)
next x
Case "D"
Stepper = -1
for x = 1 to cnt
NxtChrVal% = Asc(Mid(string1$,x,1))+(x*Stepper)
IF NxtChrVal% < 0 THEN NxtChrVal% = NxtChrVal% + 128

Res$ = Res$+Chr(NxtChrVal%)
next x
End Select

Mix = Res$
End function
----------------------------------

Gilles.
 
I found an other problem when I use an accent letter like éèê (in french). I modified value 128 by 256 then a couple of lines was modified.
replace
IF NxtChrVal% > 128 THEN NxtChrVal% = NxtChrVal% - 128
by
IF NxtChrVal% > 256 THEN NxtChrVal% = NxtChrVal% - 256

replace
IF NxtChrVal% < 0 THEN NxtChrVal% = NxtChrVal% + 128
by
IF NxtChrVal% < 0 THEN NxtChrVal% = NxtChrVal% + 256

Gilles.

 
Good job Giles. I had actuallly moved to a version that was even more restrictive (only a portion of the 128 ASCII set). Your version should support the full unicode set.

Regards,

Dave Griffin


The Decision Support Group
Reporting Consulting with Cognos BI Tools
&quot;Magic with Data&quot;
[pc2]
Want good answers? Read FAQ401-2487 first!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top