<p>Jenkins uses string interpolation to take password as input and it uses AES to encrypt and protect secrets, credentials, and their respective encryption keys.</p>
<p>So, using direct or simple approach will not work. Although you can try to assign the password to a string variable and the print it in log it works in most the cases until the password itself is saved after encrypting.</p>

CC BY-SA 4.0
2022-11-18T12:29:49.217Z
2022-11-18T12:29:49.217Z
Aniket Kumar
<p>In my secrets folder I have these files</p>
<pre><code>-rw-r--r--  1 root root  272 Oct  2 11:07 hudson.console.AnnotatedLargeText.consoleAnnotator
-rw-r--r--  1 root root   48 Sep 23 11:40 hudson.console.ConsoleNote.MAC
-rw-r--r--  1 root root   32 Sep 23 11:42 hudson.model.Job.serverCookie
-rw-r--r--  1 root root  272 Sep 23 11:39 hudson.util.Secret
-rw-r--r--  1 root root   32 Sep 23 11:16 jenkins.model.Jenkins.crumbSalt
-rw-r--r--  1 root root  256 Sep 23 11:16 master.key
-rw-r--r--  1 root root  272 Sep 23 11:16 org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
-rw-r--r--  1 root root  272 Sep 23 11:49 org.jenkinsci.plugins.workflow.log.ConsoleAnnotators.consoleAnnotator
-rw-r--r--  1 root root   48 Sep 23 11:39 org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices.mac
</code></pre>
<p>In my case hudson.utils.secrets is binary</p>
<pre><code>od -h hudson.util.Secret 
0000000 5f25 eee1 0763 1b49 c074 ee22 af85 4e10
0000020 00cf dd32 b568 fae3 257a 8d6e 1e56 d995
</code></pre>
<p>I installed groovy,I looked at <a href="https://devops.stackexchange.com/questions/2191/how-to-decrypt-jenkins-passwords-from-credentials-xml">HOW TO DECRYPT FROM CREDENTIALS</a>
What should I do?</p>

CC BY-SA 4.0
2022-11-18T17:14:28.773Z
The question you linked to does in fact have an answer for this question.  As documented in [this answer](https://devops.stackexchange.com/a/8692/4115), you can use the script console to fetch credentials from the credentials store before decrypting them; you don't have to find the credentials in the filesystem manually.
jayhendren
CC BY-SA 4.0
2022-11-18T17:20:48.830Z
Also, hudson.util.Secret, as far as I'm aware, does not have any secrets or credentials inside of it.  Credentials are stored in credentials.xml, which is located one folder up from hudson.util.Secret.
jayhendren
<jenkins>
How to decrypt Jenkins password?
MikiBelavista
# How to decrypt Jenkins password?

(Asked by: username_0 on 2022-11-17)

In my secrets folder I have these files
-rw-r--r--  1 root root  272 Oct  2 11:07 hudson.console.AnnotatedLargeText.consoleAnnotator
-rw-r--r--  1 root root   48 Sep 23 11:40 hudson.console.ConsoleNote.MAC
-rw-r--r--  1 root root   32 Sep 23 11:42 hudson.model.Job.serverCookie
-rw-r--r--  1 root root  272 Sep 23 11:39 hudson.util.Secret
-rw-r--r--  1 root root   32 Sep 23 11:16 jenkins.model.Jenkins.crumbSalt
-rw-r--r--  1 root root  256 Sep 23 11:16 master.key
-rw-r--r--  1 root root  272 Sep 23 11:16 org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
-rw-r--r--  1 root root  272 Sep 23 11:49 org.jenkinsci.plugins.workflow.log.ConsoleAnnotators.consoleAnnotator
-rw-r--r--  1 root root   48 Sep 23 11:39 org.springframework.security.web.authentication.rememberme.TokenBasedRememberMeServices.mac

In my case hudson.utils.secrets is binary
od -h hudson.util.Secret 
0000000 5f25 eee1 0763 1b49 c074 ee22 af85 4e10
0000020 00cf dd32 b568 fae3 257a 8d6e 1e56 d995

I installed groovy,I looked at HOW TO DECRYPT FROM CREDENTIALS
What should I do?

**Tags:** jenkins

> **Comments:**
> **username_1**: The question you linked to does in fact have an answer for this question.  As documented in [this answer](https://devops.stackexchange.com/a/8692/4115), you can use the script console to fetch credentials from the credentials store before decrypting them; you don't have to find the credentials in the filesystem manually.  
> **username_1**: Also, hudson.util.Secret, as far as I'm aware, does not have any secrets or credentials inside of it.  Credentials are stored in credentials.xml, which is located one folder up from hudson.util.Secret.  

---

## 1 answers

### Answer by username_2 on 2022-11-18. Score: 0 | Accepted answer

Jenkins uses string interpolation to take password as input and it uses AES to encrypt and protect secrets, credentials, and their respective encryption keys.

So, using direct or simple approach will not work. Although you can try to assign the password to a string variable and the print it in log it works in most the cases until the password itself is saved after encrypting.


---

