amcrypt-ossl.sh (amanda-tag-community-3.5.2) | : | amcrypt-ossl.sh (amanda-tag-community-3.5.3) | ||
---|---|---|---|---|
skipping to change at line 77 | skipping to change at line 77 | |||
fi | fi | |||
# we'll need to pad the datastream to a multiple of the cipher block size prior | # we'll need to pad the datastream to a multiple of the cipher block size prior | |||
# to encryption. 96 bytes (= 768 bits) should be good for any cipher. | # to encryption. 96 bytes (= 768 bits) should be good for any cipher. | |||
pad() { | pad() { | |||
perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $ bs; END { print "\0" x ($bs - $nbytes) }' | perl -pe 'BEGIN { $bs = 96; $/ = \8192 } $nbytes = ($nbytes + length) % $ bs; END { print "\0" x ($bs - $nbytes) }' | |||
} | } | |||
if [ "$1" = -d ]; then | if [ "$1" = -d ]; then | |||
# decrypt | # decrypt | |||
"${OPENSSL}" enc -d "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE }" | "${OPENSSL}" enc -d -pbkdf2 "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PA SSPHRASE}" | |||
else | else | |||
# encrypt | # encrypt | |||
pad | "${OPENSSL}" enc -e "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASS PHRASE}" | pad | "${OPENSSL}" enc -e -pbkdf2 "-${CIPHER}" -nopad -salt -pass fd:3 3< "${PASSPHRASE}" | |||
fi | fi | |||
End of changes. 2 change blocks. | ||||
2 lines changed or deleted | 2 lines changed or added |