Skip to content

Commit

Permalink
Added ' -pbkdf2 -iter 10000 ' to openssl command
Browse files Browse the repository at this point in the history
Added in order to avoid this warning message:

  *** WARNING : deprecated key derivation used.
  Using -iter or -pbkdf2 would be better.

Relevant:
 elasticdog#55
 https://askubuntu.com/questions/1093591/how-should-i-change-encryption-according-to-warning-deprecated-key-derivat
  • Loading branch information
Jacek Slaby committed Mar 7, 2020
1 parent 12f2c9d commit c5d335c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions transcrypt
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ save_helper_scripts() {
cipher=$(git config --get --local transcrypt.cipher)
password=$(git config --get --local transcrypt.password)
salt=$(openssl dgst -hmac "${filename}:${password}" -sha256 "$filename" | tr -d '\r\n' | tail -c 16)
ENC_PASS=$password openssl enc -$cipher -md MD5 -pass env:ENC_PASS -e -a -S "$salt" -in "$tempfile"
ENC_PASS=$password openssl enc -$cipher -md MD5 -pbkdf2 -iter 10000 -pass env:ENC_PASS -e -a -S "$salt" -in "$tempfile"
fi
fi
EOF
Expand All @@ -307,7 +307,7 @@ save_helper_scripts() {
trap 'rm -f "$tempfile"' EXIT
cipher=$(git config --get --local transcrypt.cipher)
password=$(git config --get --local transcrypt.password)
tee "$tempfile" | ENC_PASS=$password openssl enc -$cipher -md MD5 -pass env:ENC_PASS -d -a 2>/dev/null || cat "$tempfile"
tee "$tempfile" | ENC_PASS=$password openssl enc -$cipher -md MD5 -pbkdf2 -iter 10000 -pass env:ENC_PASS -d -a 2>/dev/null || cat "$tempfile"
EOF

cat <<-'EOF' >"${GIT_DIR}/crypt/textconv"
Expand All @@ -317,7 +317,7 @@ save_helper_scripts() {
if [[ -s $filename ]]; then
cipher=$(git config --get --local transcrypt.cipher)
password=$(git config --get --local transcrypt.password)
ENC_PASS=$password openssl enc -$cipher -md MD5 -pass env:ENC_PASS -d -a -in "$filename" 2>/dev/null || cat "$filename"
ENC_PASS=$password openssl enc -$cipher -md MD5 -pbkdf2 -iter 10000 -pass env:ENC_PASS -d -a -in "$filename" 2>/dev/null || cat "$filename"
fi
EOF

Expand Down

0 comments on commit c5d335c

Please sign in to comment.