Results 1 to 2 of 2

Thread: encryption

  1. #1
    Join Date
    Dec 1969

    Default encryption

    I am using this function to encrypt a passwd before I post it to a table.<BR><BR>-----------------------<BR> Function EnCrypt(strCryptThis)<BR> Dim strChar, iKeyChar, iStringChar, i<BR> for i = 1 to Len(strCryptThis)<BR> iKeyChar = Asc(mid(g_Key,i,1))<BR> iStringChar = Asc(mid(strCryptThis,i,1))<BR> &#039;****uncomment below to encrypt with addition<BR> &#039;iCryptChar = iStringChar + iKeyChar<BR> iCryptChar = IKeyChar Xor iStringChar<BR> strEncrypted = strEncrypted & Chr(iCryptChar)<BR> <BR> next<BR> EnCrypt = strEncrypted<BR> End Function<BR>----------------------------------<BR><BR>My problem is that when the passwd is encrypted part of the string is a &#039; . This is causeing problems on the insertion. How do I replace or skip this shar from being used?

  2. #2
    Join Date
    Dec 1969

    Default RE: encryption

    Use the vbscript Replace function. This will remove all single quotes:<BR><BR>strEncyped = Replace(strEncrypted, "&#039;", "")<BR><BR>Or you can replace them all with two single wuotes to be able to insert it ionto the database:<BR><BR>strEncyped = Replace(strEncrypted, "&#039;", "&#039;&#039;")<BR><BR>

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts