My mistake, c is CODE.

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com

 

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Lew Hundley
Sent:
Wednesday, August 27, 2003 2:33 PM
To: [EMAIL PROTECTED]
Subject: RE: [Talk] Password Security in VB and VBA

 

OK, Rich, I am either going to look like I don’t know what I am doing and should quit programming, or I am truly confused. I hope I am only confused.

 

I accept that the XOR with the ASC and the MID, will somehow in/decrypt the password, but

1.       What is ‘c’ in the XOR?

2.       Where is the constant CODE used, and how? ( was the ‘c’ suppose to be ‘CODE’ to provide an encryption string?)

 

TKs

Lew Hundley
Information Specialist - Programmer
Silverton Hospital
Silverton
Oregon
503.873.1657
[EMAIL PROTECTED]

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Rich McNeil
Sent:
Wednesday, August 27, 2003 11:16 AM
To: [EMAIL PROTECTED]
Subject: [Talk] Password Security in VB and VBA

 

About password security in VB and VBA...in VB...scripts can be secured by compiling them and VBA files can be locked with a password.  This doesn’t prevent viewing the file image in a text editor and possibly distinguishing a password there.

 

Entering the password string, say "ABCD", can be hidden with a simple Xor encryption such as:

 

      Enter Crypt("05&6")

 

Where Crypt is:

 

      Function Crypt(ByVal PW As String) As String

      Dim i As Integer

      Const CODE = "qwertyasdfjklqweru"

          For i = 1 To Len(PW)

              Mid(PW, i, 1) = Chr(Asc(Mid(PW, i, 1)) Xor Asc(Mid(c, i, 1)))

          Next

          Crypt = PW

      End Function

 

and "05&6" is equal to Crypt("ABCD").

 

 

 

Rich McNeil

Boston Software Systems

866 653 5105

www.bostonworkstation.com

 

 

Reply via email to