Basic encryption
Basic encryption is one of the three ways to encrypt database passwords. See also, Advanced encryption and Custom encryption.
For this method, we'll use Base64Cipher, which is a way to achieve simple obfuscation of the database password.
Step 1. Encrypt the password
Go to
<Bitbucket-installation-directory>/tools/atlassian-password
.Run the following command to encrypt your password:
java -cp "./*" com.atlassian.db.config.password.tools.CipherTool
Step 2. Add the encrypted password to the properties file
Go to Bitbucket home directory and back up the
bitbucket.properties
file. Move the backup to a safe place outside of your Bitbucket instance.In the
bitbucket.properties
file, replace thejdbc.password
property with the password generated by CLI. Also, specify thejdbc.password.decrypter.classname
property. For example:jdbc.password.decrypter.classname=com.atlassian.db.config.password.ciphers.base64.Base64Cipher jdbc.password=put-the-obfuscated-password-generated-by-the-cli-tool-here
Restart Bitbucket.
Decrypting the password
To decrypt the password, extend the command with the -m decrypt parameter:
java -cp "./*" com.atlassian.db.config.password.tools.CipherTool -m decrypt
When asked for a password, provide the encrypted one from your bitbucket.properties
file.