A simple Python tool for encrypting and decrypting MySQL Workbench's workbench_user_data.dat
file using the Windows Data Protection API (DPAPI).
- Decrypt
workbench_user_data.dat
: Convert the encrypted MySQL Workbench connection file into a human-readable format. - Encrypt
workbench_user_data.dat
: Convert the human-readable format back into a secure, encrypted file for use in MySQL Workbench.
-
Clone the repository:
git clone https://github.com/yourusername/WorkbenchCrypto.git cd WorkbenchCrypto
-
Install dependencies:
pip install -r requirements.txt
Run the script to encrypt or decrypt the workbench_user_data.dat
file:
python main.py
-
Decrypt the
workbench_user_data.dat
File- Select
d
for decryption when prompted. - Confirm or specify the input and output file paths.
- Default:
- Input:
workbench_user_data.dat
- Output:
workbench_user_data_decrypted.txt
- Input:
Important: Decryption must be performed on the same system and user account where the file was originally encrypted. This is because DPAPI ties the encryption to the specific Windows user and machine.
Output:
Decryption successful. Decrypted data saved to: workbench_user_data_decrypted.txt
- Select
-
Encrypt the
workbench_user_data.dat
File- Select
e
for encryption when prompted. - Confirm or specify the input and output file paths.
- Default:
- Input:
workbench_user_data_decrypted.txt
- Output:
workbench_user_data.dat
- Input:
Note: Encryption is currently in beta and has not been tested in several scenarios. Use with caution and verify the results before relying on them in production environments.
Output:
Encryption successful. Encrypted data saved to: workbench_user_data.dat
- Select
Mode | Input File | Output File |
---|---|---|
Encrypt | workbench_user_data_decrypted.txt |
workbench_user_data.dat |
Decrypt | workbench_user_data.dat |
workbench_user_data_decrypted.txt |
You can override these paths when prompted.
- Windows OS: The tool relies on the Windows Data Protection API (DPAPI).
- Python 3.x
pywin32
library: Install it via pip.
Install dependencies:
pip install -r requirements.txt
- Windows-Only: This tool uses DPAPI, which is exclusive to Windows.
- Handle with Care: The decrypted file contains sensitive credentials. Delete it securely after use.
- Encryption Scope: Files encrypted with DPAPI are tied to the specific user account and machine.
- System Dependency: Decryption must be performed on the original system and user account where the file was created.
This project is licensed under the MIT License. See the LICENSE file for details.
Sebin Benjamin
- GitHub: @sebinbenjamin