Inserting encrypted password into SQL database

Results 1 to 2 of 2

Thread: Inserting encrypted password into SQL database

  1. #1
    Srilatha Guest

    Default Inserting encrypted password into SQL database

    Hi,<BR><BR>I grabbed one of the encrpting/decryptig algorithms&#039 from the articles section and made some modifications to it. The encrypt and decrypt function is working fine.<BR>I inserted this encrypted password into the SQL tables. When I do a checking by retrieving it, the crypted password is not exactly the same as the earlier one.<BR>I am not sure what&#039s wrong with the update of the database.<BR>These are my results -<BR>First I display both the encrypted and decrypted passwords and see whether the actual password is displayed.It works fine<BR><BR>The ecnrypted string is ¯¦©eg* <BR>The decrypted string is abc123<BR><BR>abc123 happens to be my actual string. This was prior to insert into database.<BR>Now I update my database with this crypted password.<BR>When I try to retrieve it later and display it out - following is the result I get -<BR><BR>The crypted password from database table is _¦ceg+ <BR>The decrypted/actual password is b12<BR><BR>As you can see, the actual string is different. I am not sure what&#039s going wrong in the insert portion.<BR><BR>Pls. help,<BR>Thanks,<BR>Srilatha<BR><BR>

  2. #2
    Michael Swanson Guest

    Default RE: Inserting encrypted password into SQL database

    Srilatha:<BR><BR>My guess is that when you&#039re storing the extended characters present in the encrypted string, SQL server is converting them improperly...probably due to an incorrect codepage (or something along those lines). So, the data that gets stored is already wrong, and when you read it back, it will obviously not decrypt the same.<BR><BR>You can probably avoid this by storing your encrypted password using CHAR(x) + CHAR(y) + CHAR(z), etc.<BR><BR>Michael Swanson, MCSE, MCP+Internet<BR>Webmaster<BR>Donnelly Corporation<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