Skip to content

Instantly share code, notes, and snippets.

Created September 23, 2015 11:36
  • Star 63 You must be signed in to star a gist
  • Fork 26 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Decrypting Jenkins Password
#To Decrypt Jenkins Password from credentials.xml
#go to the jenkins url
#In the console paste the script
passwd = hudson.util.Secret.decrypt(hashed_pw)
Copy link

hughsaunders commented Jan 8, 2018

You can also find the encrypted key by inspecting the default value in the credentials update form.

Copy link

How to decrypt credentials stored as a secret file?

Copy link

egr-ext commented Mar 9, 2018

@vijayg92 have you find a solution for a secret file stored in credentials.xml ?

Copy link

@vijayg92 , @egr-ext
I use the code that I've posted before.

Copy link

remember that this needs the "="




String key = "tmdHc/YjAIu1O/XxwnyLTjgHIK1h95JwpskSy23Khj5="
def secret = hudson.util.Secret.fromString(key)

Copy link

@vijayg92 , @egr-ext This works for me:

println(new String(com.cloudbees.plugins.credentials.SecretBytes.fromString("{....}").getPlainData(), "ASCII"))

Copy link

TheFluo commented Aug 24, 2023

Hello, if you don't have acces to the console ... to verify for example the LDAP password that was encrypted ... how do you decrypt the generated password in the config.xml for the LDAP ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment