How To Manually Encrypt Clear Text Passwords using Spring CLI

From version 4.2.4 we introduced new functionality, Clear Text Password Encryption. With this, when you create a new SDK project and enter passwords through the wizard, the automatic file generator will encrypt the pass using the encryption key that you are using. Note that if you didn't define a key, then the default one is changeme). The encrypted passwords will be saved to the application.yml. 

In some cases we might have to migrate projects between earlier versions that don't have this ability or the password needs to be updated. To save it encrypted, the password must be encrypted manually.

How To Encrypt a Password

  1. Install Spring CLI on your machine, for Windows users the best way will be to download the Spring CLI zip and install the bat file in the /bin directory(we are using SpringBoot 2.X). You can also follow this guide .
  2. After installing the CLI you need to install the Spring Cloud extension. In cmd type: 

    https://github.com/spring-cloud/spring-cloud-cli/tree/2.2.x


  3. Now that you have installed the Spring Cloud extension, run the following to encrypt your password: 

For Windows users

Please keep in mind that if you are using Windows command prompt or PowerShell the safe way to cipher your password is putting the password inside double quotes.

Ex.:

spring encrypt "l3x1000" --key changeme


  1. Copy the encrypted password to your application yml password field as follows: '{cipher}<ENCRYPTED PASSWORD>'

We use Spring Cloud encryption to encrypt and decrypt passwords behind the scenes. For this reason we strongly recommend manually encrypting passwords using the same encryption mechanism

Filter by label

There are no items with the selected labels at this time.