Skip to content

Decrypt DBeaverData/credentials-config.json

License

Notifications You must be signed in to change notification settings

Tatsh/dbeaver-creds

Repository files navigation

dbeaver-creds

QA PowerShell Gallery Version (including pre-releases) PowerShell Gallery Platform Support

Decrypt DBeaver's credentials-config.json file and display the output (a JSON string).

You can use this in one of three ways depending on your platform and shell:

  • A Bash script that works on Linux, macOS and Windows. It requires openssl and dd to be in PATH.
  • A PowerShell module that exposes function Show-DBeaver-Credential-Json (alias dbeaver-creds). This does not require openssl or dd to function.
  • Windows only: A Batch script script equivalent to the Bash script and has the same requirements.

Installation

Place dbeaver-creds (or dbeaver-creds.bat) in PATH.

PowerShell

Install-Module -Name DBeaverCreds

Usage

dbeaver-creds

If the credentials file cannot be found, the exit status will be > 0.

PowerShell

Show-DBeaver-Credential-Json
# or the alias:
dbeaver-creds

Development

Requirements:

  • Bash
  • GNU sed
  • Perl
  • Yarn
  • curl
  • cut
  • grep
  • tr

Notes

The decryption key is from the DBeaver source.

It can be converted to hexadecimal like so in Python:

import struct
as_hex = struct.pack('<16b', 0, 1, 2, etc).hex()

update-key.sh demonstrates conversion using shell script.

Tasks

  • yarn format: to format the project's files.
  • yarn qa: Perform a QA check.
  • yarn update-key or update-key.sh: update the key in dbeaver-creds.