Search code examples
encryptionpasswordstalend

How to change encrypted password in context file without using the studio


I am using a group context to configure the db connection. The password of the db has a password type. When deploying the job, the password is automatically encrypted in the default.properties under the contexts folder. What if i want to change the password without using the studio (on a client environment)? what can i use to encrypt the new password?


Solution

  • I was able to do it by creating a separate encryption job with a tjava component and the following code:

    System.out.println(routines.system.PasswordEncryptUtil.encryptPassword(context.Password));
    

    where context.Password is an input context variable of type String. When running the job, the user is prompted to enter a password and then the encrypted Talend password will be printed. It will have the following format: enc:routine.encryption.key.v1:[encryptedPassword] The routine encryption key can be modified if needed by following this link: https://help.talend.com/r/en-US/8.0/installation-guide-data-integration-windows/rotating-encryption-keys-in-talend-studio