UNIX File Encryption howto

https://w‮al.ww‬utturi.com
UNIX File Encryption howto

There are several ways to encrypt files on a UNIX-like system, such as Linux or BSD. Here are a few options:

  1. GPG (GNU Privacy Guard): GPG is a free and open-source encryption tool that can be used to encrypt and sign files and messages. To encrypt a file using GPG, you can use the gpg command with the --encrypt option. For example:
gpg --encrypt --recipient example@example.com file.txt

This will encrypt the file file.txt using the public key of the recipient (example@example.com). The encrypted file will have the extension .gpg.

  1. OpenSSL: OpenSSL is a widely used encryption tool that is included with many UNIX-like systems. To encrypt a file using OpenSSL, you can use the openssl command with the enc option. For example:
openssl enc -aes-256-cbc -salt -in file.txt -out file.enc

This will encrypt the file file.txt using the AES-256-CBC encryption algorithm and write the encrypted data to a new file called file.enc.

  1. tar and gzip: tar is a utility for creating and extracting archive files, and gzip is a utility for compressing and decompressing files. To create an encrypted tar archive using gzip, you can use the tar and gzip commands together with the --gzip and --encrypt options. For example:
tar -czvf - file.txt | gzip --encrypt --stdout > file.tgz

This will create an encrypted tar archive called file.tgz containing the file file.txt.

Created Time:2017-10-30 14:27:22  Author:lautturi