ARTIFACTORY: How to Address "BadPaddingException" After Changing a Password

ARTIFACTORY: How to Address "BadPaddingException" After Changing a Password

AuthorFullName__c
David Shin
articleNumber
000006045
ft:sourceType
Salesforce
FirstPublishedDate
2024-03-05T08:53:09Z
lastModifiedDate
2025-05-21
VersionNumber
4

If you encounter the error message "javax.crypto.BadPaddingException: Given final block not properly padded" or "Failed to decrypt password" after changing a password, and this issue is unique to your account while other users remain unaffected, you may be puzzled.

It might be perplexing, especially if you are confident that you are using a plain-text password. 
The error indicates that Artifactory is attempting to decrypt the password, raising questions about what might be happening behind the scenes.

To gain insights into the issue, you can enable debugging by modifying the /var/opt/jfrog/artifactory/etc/artifactory/logback.xml file. Set the debug logger for the security package in the logback.xml file:

 <logger name="org.artifactory.security"> 
      <level value="trace"/>
  </logger>

Reproduce the issue and examine the artifactory-service.log file for further details.
If you observe a trace message indicating "Detected encrypted password," Artifactory may be interpreting your plain-text password as encrypted due to a specific pattern.

To investigate further, carefully examine your password.
A noteworthy pattern to be aware of is when a plain-text password begins with "AP." Artifactory may detect such passwords as encrypted due to the presence of these reserved keywords.

To avoid this issue, refrain from using passwords that start with the capital letters 'A' and 'P.' Adjusting your password accordingly should resolve the "BadPaddingException" you encountered after a password change.
Once the issue is resolved, don't forget to remove the logger.

Note: Please remove the debug logger once the issue is resolved to prevent performance degradation.