Files
vault/Technical/Linux/GPG Encryption.md
Zaine 5d3ed14275
Some checks failed
Build Quartz Notes / build (push) Failing after 2m40s
updates
2026-06-04 14:47:44 +01:00

36 lines
744 B
Markdown
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
---
note type:
- note
date: 2026-06-03
done: true
---
If you want to encrypt a file, use the following command:
``` bash
gpg -c file.txt
# options include :
# gpg -c file.txt : for symmetric encryption
# gpg -d file.txt.gpg : to decrypt the file
# gpg --batch -c --passphrase mypassphrase file.txt : accepts passphrase right from command line
```
and to decrypt, use:
``` bash
gpg -d file.txt
# You have to wait 10 minutes before you can get prompted for a password, before this, it will
# decrypt without the passphrase.
```
`gpg batch -c passphrase Shakkal123! passwords.md`
`gpg batch -d passphrase Shakkal123! passwords.md.gpg`
`gpg batch output passwords.md -d passphrase Shakkal123! passwords.md.gpg`