Endpoint Management

Encrypting a Password to Use in Scripts in Jamf Pro

Last modified 7/9/2020

About

This guide will show you to encrypt your passwords to be able to use in parameters for scripts in Jamf Pro.

Getting Started

  1. On a macOS device, open the Terminal app.
  2. Run the following script block to load the function.

    function GenerateEncryptedString() {
    local STRING="${1}"
    local SALT=$(openssl rand -hex 8)
    local K=$(openssl rand -hex 12)
    local ENCRYPTED=$(echo "${STRING}" | openssl enc -aes256 -a -A -S "${SALT}" -k "${K}")
    echo "Encrypted String: ${ENCRYPTED}"
    echo "Salt: ${SALT} | Passphrase: ${K}"
    }



  3. Run the loaded function with the password you would like to encrypt.

    GenerateEncryptedString 'YourPasswordHere'



  4. You can take the outputted Encrypted String, Salt, and Password and use in the scripts parameters in Jamf Pro.