HomeSetup Developer Handbook
Standard-Tools
Table of contents
Security related functions
__hhs_encrypt_file
usage: __hhs_encrypt_file <filename> <passphrase> [keep]
Purpose
Encrypt file using GPG.
Returns
0 on success; non-zero otherwise.
Parameters
- $1 Required : The file to encrypt.
- $2 Required : The passphrase used to encrypt the file.
- $3 Required : If provided, keeps the decrypted file, delete it otherwise.
Examples
encrypt test.txt '12345'
Output
File "test.txt" has been encrypted !
__hhs_decrypt_file
usage: __hhs_decrypt_file <filename> <passphrase> [keep]
Purpose
Decrypt a GPG encrypted file.
Returns
0 on success; non-zero otherwise.
Parameters
- $1 Required : The file to decrypt.
- $2 Required : The passphrase used to decrypt the file.
- $3 Required : If provided, keeps the encrypted file, delete it otherwise.
Examples
decrypt test.txt '12345'
Output
File "test.txt" has been decrypted !