-
This project aims to automate the importation from the big techs' password managers to Proton Pass
It's a self-paced project for getting xp on solving my problems in an automated way.
This Python script is used to extract and decrypt passwords stored in Google Chrome and export them to a CSV file. It uses libraries such as os
, sqlite3
, csv
, secretstorage
, and pycryptodome
to perform its tasks.
-
Import Libraries:
- Imports the necessary libraries for file manipulation, database handling, encryption, and secure storage.
-
Define the Path to the Passwords File:
- Defines the path to the Google Chrome passwords file (
Login Data
).
- Defines the path to the Google Chrome passwords file (
-
Create a Temporary Copy of the Database:
- Creates a temporary copy of the passwords database to avoid modifying the original file.
-
Connect to the Database:
- Connects to the copied SQLite database and creates a cursor to execute queries.
-
Query the Database:
- Executes an SQL query to retrieve URLs, usernames, and encrypted passwords stored in the database.
-
Function to Decrypt Passwords:
- Defines a function
decrypt_password
that decrypts the passwords using the Chrome encryption key stored in the system keyring. - The function uses the
pycryptodome
library to perform AES decryption.
- Defines a function
-
Write Passwords to a CSV File:
- Opens a CSV file for writing and writes the column headers.
- Iterates over the records retrieved from the database, decrypts the passwords, and writes the data to the CSV file.
-
Clean Up:
- Removes the temporary database file.
-
Completion Message:
- Prints a message indicating that the process is complete.
Ensure that the following libraries are installed in your Python environment:
pycryptodome
secretstorage
You can install these dependencies using the command:
pip install pycryptodome secretstorage
- This script should be run in an environment where Google Chrome is installed and where the system keyring is accessible.
- Ensure you have the appropriate permissions to access the Chrome passwords file and the system keyring.