How to encrypt the Password column in jos_users (Joomla) - mysql

My aim was to import a CSV file full of user details into jos_users through Phpmyadmin. All columns match and it was imported without issue.
I have also applied user group definitions in the jos_usergroup_map table, without issue.
The list of users match with the backend side of Joomla but I cannot log into the new users in the front end. After playing around I have realized that the password column in jos_users must be encrypted to work. You can do this in the back end of joomla by re-typing the password and saving changes (and it encrypts it and works fine).
I was wondering. Is there a way to encrypt the jos_users password column in one go. Instead of going one by one?
Thanks again!

There is a similar thread explaining the joomla password encryption.
Joomla 3.2.1 password encryption
Write a script which will update the password as per the joomla standards, export data from jos_users table and pass this data as input to the script.

Related

How to Encrypt the whole structure of a table in phpmyadmin?

I am facing problem regarding the encryption of the structure of a table in phpmyadmin. like i want to see the structure of a table in encrypted form when i export a table from phpmyadmin. means i want that the fields of the table appear in .sql file should be encrpted so that no one can read the information about fields of the table. i have search a lot on google, yahoo but i don't find any solution to do this. Please it will be a great favour. Thanks in advance
the example is here
basically i have a table name student with fields like name, cnic, dob i want that when i export the whole table into sql file from phpmyadmin the fields name like name, cnic, dob should be appear encrypted. so the user don't able to read them. just i want to do this task
I believe you can encrypt table data while you are saving in MYSQL, so that MySQL doesn't even know it's encrypted.
Result: Whenever you export table data either from phpmyadmin, No one can read that sql or csv file without decypting it.
If you are showing data you can de-crypt it back for getting its actual form.
Note: If you encrypt your data with any method like MD5 you can't
get its actual form (De-crypt from).

Transferring MD5 hashed passwords from one MySQL to another

So I am currently building a new Wordpress site that has a functionality where users can login and create a business listing for themselves. All of these users are currently using another site of the clients to perform other business aspects.
We are looking at bringing all the sites together in time.
Right now though, I have a user table on the existing site that has login details (username, display name and password among others). I want to grab these details including the MD5 hashed password field and import it into the Wordpress users table?
Is this even possible?
Thanks,
A
It seems most of the data is transferable, you'll need a script or something to make sure all the data from your other website is inserted the right way in your wp_users and wp_usermeta table.
All data you want to save extra for users, can be inserted in the wp_usermeta table as key-value pair.
To make sure users can login into the new WordPress site :
This is possible if you set your security in WordPress using MD5 hash only without using a salt.
You can do this by overwriting wordpress's wp_hash_password() method.
But you are better of letting existing users change their PW, because MD5 is really insecure.
I have managed to find a way to do this. It may be a little backwards, and please correct me if I have this entirely wrong.
I grabbed a SQL dump from the old database using phpMyAdmin of the fields that I needed. I edited the SQL file and adjusted the field names to correlate with the Worpress wp_users table. Then in the new database I used an INSERT INTO command to create the new users.
In Wordpress I then had to assign all the new users a role.
It took the MD5 hashed password and stored it initially in the DB but on the first login it changed the encryption to phpass.
Hope this helps anyone else looking.
A

MySQL - mysql database priviledges and root user

so..
I'm watching a Tutorial Video courtesy of Lynda.com on the basics of MySQL (cool Stuff),
The instructor is instructing us on setting up Root User Password via Console (which i've actually already Done).
He stated the following :
MySQL Stores it Users,Root Users and Permission for those users in a table called user, located in a datbase called mysql
Then a little lightbulb appeared above my head and i typed this in
{SHOW DATABASES;}
{USE mysql;}
{SHOW TABLES;}
{SELECT * FROM user;)
Then a bunch of stuff appeared that was obviously all the user info
so HERE'S MY QUESTION (actually 2 if i may)
1.Am i correct in assuming that if i (hypothetically) modify they "Y"'s or the "N"'s , i then effectively alter the permissions and/or access grants to those corresponding users.
LASTLY, i have set my password, and next to my name in the list, under the password column, there is a really long string of what appears to be a Hexadecimal string
Just for fun How would i convert that back so that it shows my password
(FYI I'm familiar with conversion of Binary to hex and to decimal and so on, but i'm guessing there's some sort of encryption at work here, perhaps AES or 3DES or something)
it's starts with a Star , followed by 40 Hex Characters, my password is only 12 Characters Long
so..to finish up, in doing all this, i now think i understand what the purpose of the mysql schema is in MYSQL
and needless to say i shouldn't delete it... right LOL
all input on this subject is greatly appreciated ahead of time
thanks guys
Am i correct in assuming that if i (hypothetically) modify they "Y"'s or the "N"'s , i then effectively alter the permissions and/or access grants to those corresponding users.
Yes - however the data is cached independently of the query cache - hence updating the table won't immediately give you this access - you need to reload the privileges or restart the database before the changes take effect.
How would i convert that back so that it shows my password
You can't. It's a cryptographic hash of your password. However given enough time and enough computing resource you can find a string which results in the same hash (which might be the same as the pasword) - this could then be used to log in as that user. But we're talking about millions of CPU hours here.
Yes, you can set 'Y' or 'N' in those rows, but after modifying system security tables you will have to execute FLUSH PRIVILEGES; command. I'd suggest you to use GRANT or REVOKE command instead of editing system tables directly.
No, it is not possible to decrypt MySQL user's password.

How can I generate salt and confirmation_token entries for migrated users with FOSUserBundle

I am resurrecting a website that has been down for a few years and I am migrating everything to Symfony2. I was able to get all of my old user database entries into the fos_user table. The only problem is that the salt and confirmation_token entries are empty because users were were not created the standard way. I want all users to reset their passwords, so I'm not worried about the old hashed passwords at all. How can I generate the entries for 13,000 users at once? Maybe I need to override the controller to create the salt and confirmation_token each time a password is requested? Do methods already exist for this? It seems like someone else would have had this problem before.
Thanks
I solved this by overriding the fosUserBundle Resetting controller. Instructions can be found here.
I forced generation of a new toke with these lines:
$tokenGenerator = $this->container->get('fos_user.util.token_generator');
$user->setConfirmationToken($tokenGenerator->generateToken());
I was able to generate the salt values with a simple SQL query.
UPDATE fos_user set salt = SUBSTRING(MD5(RAND()) FROM 1 FOR 31) WHERE salt IS NULL

Drupal user data storage location

Where does Drupal 7 store user data? I believe our client has been inserting bad data (incorrect characters) copied from MS Word into their Drupal install (for their user list).
How do I export/look at the users to see if any bad characters are in them?
I'm taking a look at the structure of the database in MySQL and I'm not seeing any clear table with the data in it. Is it contained in only one, or multiple tables?
User data is stored in multiple tables one of which is the users table. Any fields that have been added to the user entity will be in the field_data_field_user... table.
If you are using phpMyAdmin or similar interface, you will only be able to immediately see a portion of the tables Drupal has. Use the filter to find "users" and the Users table will appear in the list. There is only one table if there were no modifications for custom user fields.
You can export the table as a CSV and open in a spreadsheet interface, such as Excel; though Excel is not always friendly with UTF-8 if it's not set up to display it. Or you can save the file as a .SQL and view it in a database viewer such as SQLite in Firefox.