jenkins-credentials-decryptor icon indicating copy to clipboard operation
jenkins-credentials-decryptor copied to clipboard

secretBytes is not correctly decrypted

Open rbjorklin opened this issue 4 years ago • 3 comments

It looks like most secrets are encrypted by the Secret class. This however does not seem to be the case with SecretBytes which has it's own implementation. This seems to invalidate the assumption made here which makes the code take the wrong branch (else). Forcing the use of decryptNewFormatCredentials unfortunately doesn't fix the issue.

rbjorklin avatar Oct 05 '20 23:10 rbjorklin

Any updates on this feature? Also interested.

Colum avatar Apr 15 '21 00:04 Colum

Hey, I'm blessed of not having to use Jenkins for the past couple of years, so I'd probably won't touch this decryptor in a veeeery long time. Sorry.

hoto avatar Apr 15 '21 08:04 hoto

Solution: Go to script page - http://[JENKINS]/script

and execute:

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

or:

println(hudson.util.Secret.decrypt(
    "{YOUR-SECRET}"
))

lebe-dev avatar Aug 08 '22 09:08 lebe-dev