Important Notice from AspDotNetStorefront
It is with dismay that we report that we have been forced, through the action of hackers, to shut off write-access to this forum. We are keen to leave the wealth of material available to you for research. We have opened a new forum from which our community of users can seek help, support and advice from us and from each other. To post a new question to our community, please visit: http://forums.vortx.com
Results 1 to 7 of 7

Thread: Question about EncryptKey

  1. #1
    MudDiver is offline Member
    Join Date
    May 2009
    Posts
    44

    Default Question about EncryptKey

    I changed my EncryptKey value in Web.Config and then after I did this it dawned on my that with a differant key it shouldn't be able to decrypt the passwords on the accounts already in the database. When I tried to log in though I was able to get in just fine. Am I missing something? Shouldn't changing the encrypt key prevent the site from decrypting the old passwords?
    Jason Giles
    IT Manager / Web Services
    WTS Media
    www.wtsmedia.com

  2. #2
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    The encryptkey controls the encryption for the security log in the admin site, and the encryption of CC numbers. The passwords for customer accounts are a one way hash based on the saltkey.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  3. #3
    MudDiver is offline Member
    Join Date
    May 2009
    Posts
    44

    Default

    Ok, so if I import customers into say my dev site and then copy that database to my live site when we put it up I shouldn't run into any problems with the password encryptions?
    Jason Giles
    IT Manager / Web Services
    WTS Media
    www.wtsmedia.com

  4. #4
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    How are you importing them? As long as you are moving over the entire customer record (including the SaltKey) you won't run into any issues. If you neglect the SaltKey and it's not exactly the same as in the old database, the passwords will no longer work and there will be no way for you to get them back.
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  5. #5
    MudDiver is offline Member
    Join Date
    May 2009
    Posts
    44

    Default

    Well I can generate the encryption on the password using the routines in the site as is. I have to create the customer database for the import from 2 databases and 3 tables (current website database for the password and email address, our CRM software database for the current customer information and the other table is the Addresses table from our CRM software) I am going to write several queries to combine that data into one table that is in the same format as the new Customer and Address tables in your software but if I do that the passwords would go in as clear text. I was going to write a quick script that would zip through all the passwords and save them back encrypted. I would then backup the entire database and copy it to the new location for the live site.
    Jason Giles
    IT Manager / Web Services
    WTS Media
    www.wtsmedia.com

  6. #6
    George the Great is offline Senior Member
    Join Date
    Nov 2006
    Location
    Cleveland, OH
    Posts
    1,792

    Default

    If the passwords have to write in as plain text...just set the SaltKey to -1 when importing. After you've completed the import, just touch the web.config file, run an iisreset, or restart the site through your hosting control panel. The site will automatically encrypt any plain text passwords for records that have a SaltKey of -1 when it restarts
    <a href="http://www.aspdotnetstorefront.com">Shopping Cart Software</a>

  7. #7
    MudDiver is offline Member
    Join Date
    May 2009
    Posts
    44

    Default

    Very cool! Thanks that worked.
    Jason Giles
    IT Manager / Web Services
    WTS Media
    www.wtsmedia.com