Skip to main content
Solved

openssl failing to decrypt randomly?

  • July 29, 2023
  • 2 replies
  • 7 views

Forum|alt.badge.img+4

Hi

I've been using this function to decrypt api account password in one of my scripts, and i can see it failing to decrypt in some machines. Different versions of macOS, i really can't see a pattern. Anyone seen something similar?

function decrypt_string() {

apipass=$(echo "$encrypted_string" | openssl enc -aes-256-cbc -d -salt -base64 -A -S "$salt" -k "$passphrase" )
}

 

Best answer by mm2270

I suggest taking a look at this thread. It may explain the issue and what you need to do to make it work.

FYI: Using EncryptedStrings method for Classic API... - Jamf Nation Community - 257606

2 replies

mm2270
Forum|alt.badge.img+24
  • Legendary Contributor
  • Answer
  • July 30, 2023

I suggest taking a look at this thread. It may explain the issue and what you need to do to make it work.

FYI: Using EncryptedStrings method for Classic API... - Jamf Nation Community - 257606


Forum|alt.badge.img+4
  • Author
  • Contributor
  • July 31, 2023

I suggest taking a look at this thread. It may explain the issue and what you need to do to make it work.

FYI: Using EncryptedStrings method for Classic API... - Jamf Nation Community - 257606


Yep, it was exactly that. Seems that the change was made with 2.9.1 version of Libressl. https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/libressl-2.9.1-relnotes.txt

Thanks!