Basic encryption
Basic encryption is one of the three ways to encrypt database passwords in Bitbucket Data Center and Server. 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 the Bitbucket home directory and back up the
bitbucket.propertiesfile. Move the backup to a safe place outside of your instance.In the
bitbucket.propertiesfile, replace thejdbc.passwordproperty with the password generated by CLI. Also, specify thejdbc.password.decrypter.classnameproperty. 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-hereRestart 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.