decrypt.sh 318 B

123456789101112
  1. #!/bin/bash
  2. #用于解密文件, 使用方法:./decrypt.sh output.txt decrypted.txt mypassword
  3. if [ $# -ne 3 ]; then
  4. echo "Usage: $0 <input_file> <output_file> <password>"
  5. exit 1
  6. fi
  7. input_file=$1
  8. output_file=$2
  9. password=$3
  10. openssl enc -d -aes-256-cbc -in "$input_file" -out "$output_file" -k "$password"