Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Store encrypted strings
Message
 
To
All
General information
Forum:
Microsoft SQL Server
Category:
Database design
Title:
Store encrypted strings
Miscellaneous
Thread ID:
00961816
Message ID:
00961816
Views:
44
I'm encrypting passwords using the Crypto API and checking them upon login with a SQL string like this:
lcUserPass = THIS.EncryptPasswd(PADR(lcUserPass,20))
Server.oSqlConn.cSql = [SELECT CPAUsers.* FROM CPAUsers ] + ;
	[INNER JOIN CPAOrgs ON CPAUsers.OrgCode = CPAOrgs.OrgCode ] + ;
	[WHERE (LOWER(CPAUsers.UserEmail) = '] + lcUserID + [') ] + ;
	[AND (CPAUsers.OrgCode = '] + lcOrgCode + [') AND ] + ;
	[(CPAUsers.UserPass = ']+lcUserPass+[') AND (CPAUsers.Active = 1) AND (CPAOrgs.Active = 1)]
It appears that sometimes the Crypto API generates an encrypted string that causes a SQL error.

What can I do either in syntax or in database structure to avoid this problem?

TIA
Kogo Michael Hogan

"Pinky, are you pondering what I'm pondering?"
I think so Brain, but "Snowball for Windows"?

Ideate Web Site
Next
Reply
Map
View

Click here to load this message in the networking platform