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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with encryption 1

Status
Not open for further replies.

Ashank4vba

Programmer
Apr 29, 2005
115
IN
Hi,

I need to encrypt some passwords before storing in my table.
I tried the RC4 encryption algorithm code. Although it works, it generates passwords with quotes (') and this creates problems when trying to retrieve the passwords using a query.
I do not know much about encryption and so before I use simple encryptiong logic like
character = chr(asc(character) + 10)
for encryption :), I wanted to enquire better solutions to my problem.
For example, I saw that there is a "cryptext 1.0 Type library" in the references but I do not know how to use it.

Please help!

Thanks!

-cheers
Ashank
 
with quotes (') and this creates problems when trying to retrieve
Which problems ?

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Hi PHV,

I am storing the password as text with no formatting. So if the encrypted password is something like this '@#$%, I am not able to use it in a query.
For example,
SELECT * FROM tbl WHERE pwd = ''@#$%' gives some error. I am using this from VBA.
Are there some special characters that I could use maybe, like "" for " ?

Thanks
 
strSQL = "SELECT * FROM tbl WHERE pwd=[tt]'"[/tt] & Replace(strPassword, [tt]"'"[/tt], [tt]"''"[/tt]) & [tt]"'"[/tt]

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Thanks a lot PHV. That worked.

Are there other characters that need modifications like this besides "'" for matching against text fields in tables?

Thanks!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top