Skip to content

Instantly share code, notes, and snippets.

View mtahle's full-sized avatar
🏠
Working from home

Mujahed Altahle mtahle

🏠
Working from home
View GitHub Profile
@mtahle
mtahle / secure_backup.sh
Last active July 12, 2024 21:27
encrypt and decrypt a backup file using AWS Key Management Service (KMS) and AWS S3.
#!/bin/sh
# This script provides functionality to encrypt and decrypt a backup file using AWS Key Management Service (KMS) and AWS S3.
# It takes two main commands: 'encrypt' and 'decrypt'.
# The 'encrypt' command encrypts the backup file using a data encryption key (DEK) generated by AWS KMS.
# The encrypted backup file and the encrypted DEK are then uploaded to an S3 bucket.
# The 'decrypt' command downloads the encrypted backup file and the encrypted DEK from the S3 bucket.
# It then decrypts the backup file using the DEK and saves it to a local directory.
#Author: