Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Encryption problems with xp
Message
From
30/01/2004 15:57:14
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Title:
Encryption problems with xp
Miscellaneous
Thread ID:
00872528
Message ID:
00872528
Views:
68
I have an application that uses a very simple encryption to hide login passwords. The encryption routine is based on the built in windows security as outlined in an Advisor article some time ago. The class code is:

PUBLIC oEncoder
#DEFINE T_CHARACTER "C"
#DEFINE T_NUMERIC "N"
#DEFINE T_DOUBLE "B"

oEncoder = CREATEOBJECT("encoder")

define class encoder as session
oCrypto = .f.
cKey = .F.

procedure init
this.oCrypto = newobject("_cryptapi", ".\classes\_crypt.vcx")
this.oCrypto.cProviderName = "Microsoft Base Cryptographic Provider v1.0"
this.cKey = "VFPRocks!"
endproc

function EncryptValue( cOriginalValue )
local lcCipher, luResult
lcCipher = ""
lcText = trim(cOriginalValue)
luResult = this.oCrypto.encryptSessionBlockString(lcText, this.cKey, @lcCipher)
RETURN lcCipher
endfunc

function DecryptValue( cEncryptedValue )
local lcCipher, luResult
lcText = ""
lcCipher = trim(cEncryptedValue)
luResult = this.oCrypto.decryptSessionBlockString(lcCipher, this.cKey, @lcText)
RETURN lcText
endfunc

enddefine

and this works fine with win98 and win2000. It also works with winXP except that the returned values are different than with the older versions of windows. Consequently if the original authorization was with 98 or 2000, XP will not allow the login.

Does anyone know a work around for this situation?

Thanks in advance.
Next
Reply
Map
View

Click here to load this message in the networking platform