Skip to main content
Question

Encrypted openssl aes-256 macOS Monterey cannot be decrypted with Ventura aes-256

  • Nov 4, 2022 1:55 PM UTC
  • 5 replies
  • 152 views

jkeller13
Forum|alt.badge.img+8

If you are using a decrypt string like the one below, you will encounter an error on macOS Ventura when attempting to decrypt. See below:

#!bin/bash ## Decrypt string using salt and phrase. function DecryptString() { echo "${1}" | openssl enc -aes256 -d -a -A -S "${2}" -k "${3}" }

bad decrypt

4370875948:error:06FFF064:digital envelope routines:CRYPTO_internal:bad decrypt:/AppleInternal/Library/BuildRoots/a0876c02-1788-11ed-b9c4-96898e02b808/Library/Caches/com.apple.xbs/Sources/libressl/libressl-2.8/crypto/evp/evp_enc.c:521:

 

SOLUTION:

You will need to add "-md md5" to your enc string. This will work across macOS versions 13 back through at least 10.12.

#!bin/bash ## Decrypt string using salt and phrase. function DecryptString() { echo "${1}" | openssl enc -md md5 -aes256 -d -a -A -S "${2}" -k "${3}" }

 

5 replies

AJPinto
Forum|alt.badge.img+26
  • Legendary Contributor
  • Nov 7, 2022 1:35 PM UTC

 

I have just been redoing the encrypt and updating the decrypt, I'm just lazy and did not feel like researching. Very good information. 

 

For those who pass passwords in plaintext in scripts. Save this and start encrypting your passwords.


catalana
Forum|alt.badge.img+1
  • New Contributor
  • Jan 17, 2023 7:34 PM UTC

Thank you for this info.  This was my resolution to my issue/problem.


Forum|alt.badge.img+4
  • Contributor
  • Feb 6, 2023 3:06 PM UTC

Just bumped into this issue. Many thanks for solution.


bradtchapman
Forum|alt.badge.img+20
  • Valued Contributor
  • Mar 1, 2023 1:10 AM UTC

This post is still the gift that keeps on giving.


Forum|alt.badge.img+15
  • Contributor
  • Apr 14, 2023 12:40 AM UTC

Thank you very much! Helped us avoid extra steps on thousands of computers while keeping the information encrypted :) 👍