Skip to content

Commit

Permalink
feat: 🎸 encrypt with pbkdf2
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed Oct 18, 2024
1 parent 83fced8 commit a24cb25
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion webdav-backup/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
FROM alpine:latest

LABEL MAINTAINER [email protected]
LABEL VERSION 1.1.1
LABEL VERSION 1.1.2

# 安装必要的工具
RUN apk add --no-cache bash curl tar gzip openssl && mkdir -p /data
Expand Down
2 changes: 1 addition & 1 deletion webdav-backup/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ encrypt_file() {

if [ "$ENCRYPTION_ENABLED" = true ]; then
echo "正在加密文件: ${input_file}"
openssl enc -aes-256-cbc -salt -in "$input_file" -out "${input_file}.tmp" -k "$ENCRYPTION_PASSWORD"
openssl enc -aes-256-cbc -pbkdf2 -salt -in "$input_file" -out "${input_file}.tmp" -k "$ENCRYPTION_PASSWORD"
mv "${input_file}.tmp" "$output_file"
fi
}
Expand Down
2 changes: 1 addition & 1 deletion webdav-backup/restore.sh
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ download_and_decrypt_backup() {
echo "文件下载成功。"
if [ "$ENCRYPTION_ENABLED" = true ]; then
echo "正在解密文件..."
openssl enc -d -aes-256-cbc -in "$output_file" -out "${output_file}.tmp" -k "$ENCRYPTION_PASSWORD"
openssl enc -d -aes-256-cbc -pbkdf2 -in "$output_file" -out "${output_file}.tmp" -k "$ENCRYPTION_PASSWORD"
mv "${output_file}.tmp" "$output_file"
fi
else
Expand Down

0 comments on commit a24cb25

Please sign in to comment.