any way to decrypt the password saved in database ?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
10 anos atrás
I am trying to transfer the customers list to my other custom site database but other site required two fields, password (visible text) and salt key.

How to transfer the customers with "PasswordHash" field to the other site table ?
10 anos atrás
You should have a PasswordSalt column on the same table.
10 anos atrás
how I can decrypt password from password salt ? as in my other website database table, I have to provide password field (which is simple text where I can see the password as admin)
10 anos atrás
You can't, they are one way hashes.  The user supplies their password, it gets hashed with the salt and then the hash is compared to the one in the database.  If they match, it's the right password and you can log in.

It's also the correct way to handle passwords.  You don't want the responsibility of knowing a user's password because if you get hacked and your DB is downloaded then they have to brute force each password individually.  If you store them unencrypted then it's just simple and they can take a user's password from your site and see if that's also their gmail, banking, facebook, etc password.
10 anos atrás
any advise how to deal in this situation ? I have almost 1000 customers that I need to transfer to other website database ?

I can't leave the password field blank in other site's database and it will affect all the customer's account and everyone will have to reset their password.
10 anos atrás
pepper wrote:
any advise how to deal in this situation ? I have almost 1000 customers that I need to transfer to other website database ?

I can't leave the password field blank in other site's database and it will affect all the customer's account and everyone will have to reset their password.


Does the new site already have a list of customers using it?  If it were me, I would use the same password implementation as Nop.  You could also use the Password Format part so that your existing user's on the new site are unencrypted and the ones you import are encrypted.  Set it up so that when your old users log in, it hashes their password and switches their format.  Eventually everyone would be encrypted.  

Or you could also write a batch script to encrypt all your existing users passwords at once.
10 anos atrás
My new site is another asp.net open source site so customizing the whole user password system is a very big task.

I can't do anything ? any alternative ?
10 anos atrás
can anyone please explain how the passwords in nopcommerce are being hashed ? What is the algorithm ?
10 anos atrás
public virtual string CreatePasswordHash(string password, string saltkey, string passwordFormat = "SHA1")
        {
            if (String.IsNullOrEmpty(passwordFormat))
                passwordFormat = "SHA1";
            string saltAndPassword = String.Concat(password, saltkey);
            
            var algorithm = HashAlgorithm.Create(passwordFormat);
            if (algorithm == null)
                throw new ArgumentException("Unrecognized hash name", "hashName");

            var hashByteArray = algorithm.ComputeHash(Encoding.UTF8.GetBytes(saltAndPassword));
            return BitConverter.ToString(hashByteArray).Replace("-", "");
        }
10 anos atrás
What is the name of the other site?  If they are distributing open source software that doesn't even encrypt user passwords, it needs to be fixed.  This is a really basic, must-have item similar to not guarding against SQL injection.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.