Live data from Hacker News

Using GPG to Encrypt Your Data

nas.nasa.gov

81–90 of 100 posts

Re: Using GPG to Encrypt Your Data

#81
post #45
post #28

Earlier quoted context omitted.

"Password2017" is a typical "secure" password. Capital and small letters, and number - longer than 8 characters. Passes most "checks" for passwords...

"Password2017!" is even better. It's got a special character!

Funny how most people go for ! as the default special character :)

Re: Using GPG to Encrypt Your Data

#82

Unless compatibility with gpg is a requirement, I think scrypt[0] is a much simpler tool for file encryption. The utility is meant to showcase the KDF of the same name. It's very simple and has virtually no parameters. So: $ xz -k elrond_minutes.txt $ scrypt enc elrond_minutes.txt.xz elrond_minutes.txt.xz.enc $ signify -S \ -s vilya.key \ -m elrond_minutes.txt.xz.enc \ -x elrond_minutes.txt.xz.enc.sig $ rm elrond_min…

My paranoid self wanted to replace rm with shred.

You can just pipe xz instead, although you may want to shred the original file:

  xz  file.xz.enc
And I agree: scrypt (the program) is much better for password encrypting documents. It is only a few thousand lines of readable code; it uses modern algorithm choices (scrypt, AES256-CTR, HMAC-SHA256), with no alternatives; there isn't any configuration involved; and it's written by a respected author.

Re: Using GPG to Encrypt Your Data

#83

Unless compatibility with gpg is a requirement, I think scrypt[0] is a much simpler tool for file encryption. The utility is meant to showcase the KDF of the same name. It's very simple and has virtually no parameters. So: $ xz -k elrond_minutes.txt $ scrypt enc elrond_minutes.txt.xz elrond_minutes.txt.xz.enc $ signify -S \ -s vilya.key \ -m elrond_minutes.txt.xz.enc \ -x elrond_minutes.txt.xz.enc.sig $ rm elrond_min…

My paranoid self wanted to replace rm with shred.

shred is ineffective if you're using a CoW FS, and probably less effective on a journaling FS, and those probably covers 99% of all the FS people use today. Just use FDE.

Re: Using GPG to Encrypt Your Data

#84
post #8

For GPG symmetric encryption, the kind the article describes, here are the best options I've found for my typical case: gpg --symmetric \ --cipher-algo aes256 \ --digest-algo sha256 \ --cert-digest-algo sha256 \ --compress-algo none -z 0 \ --quiet --no-greeting \ --no-use-agent "$@" I keep this command here: https://github.com/SixArm/gpg-encrypt The options are chosen to balance tradeoffs of convenience, strength, an…

Here's an alternative to wrapping GPG, using .gnupg/gpg.conf:

  personal-cipher-preferences AES256 AES
  personal-digest-preferences SHA256 SHA512
  personal-compress-preferences Uncompressed
  default-preference-list SHA256 SHA512 AES256 AES Uncompressed
  
  cert-digest-algo SHA256
  
  s2k-cipher-algo AES256
  s2k-digest-algo SHA256
  s2k-mode 3
  s2k-count 65011712
  
  disable-cipher-algo 3DES
  weak-digest SHA1
  force-mdc
Note that these options impact compatibility with other GPG/PGP clients.

Re: Using GPG to Encrypt Your Data

#85
post #51
post #43

If we're talking about GPG, please pay attention to https://www.passwordstore.org/ which is really cool, open source password manager built on GPG.

Is there anything like this that doesn't leak the folder structure in plaintext? Manually obfuscating site names would be very tedious.

You may like https://github.com/bwesterb/pol which "is a modern command line password manager with deniable encryption".

Re: Using GPG to Encrypt Your Data

#86
post #45

Earlier quoted context omitted.

"Password2017!" is even better. It's got a special character!

Funny how most people go for ! as the default special character :)

It adds to the excitement of logging into an application. Instead of "login", you get to "login!".

Re: Using GPG to Encrypt Your Data

#87
post #45

Earlier quoted context omitted.

"Password2017!" is even better. It's got a special character!

Funny how most people go for ! as the default special character :)

I think it's a natural outgrowth of how so many people chose "1" when they were forced to add a number to their passwords.

Re: Using GPG to Encrypt Your Data

#88
post #84
post #8

For GPG symmetric encryption, the kind the article describes, here are the best options I've found for my typical case: gpg --symmetric \ --cipher-algo aes256 \ --digest-algo sha256 \ --cert-digest-algo sha256 \ --compress-algo none -z 0 \ --quiet --no-greeting \ --no-use-agent "$@" I keep this command here: https://github.com/SixArm/gpg-encrypt The options are chosen to balance tradeoffs of convenience, strength, an…

Here's an alternative to wrapping GPG, using .gnupg/gpg.conf: personal-cipher-preferences AES256 AES personal-digest-preferences SHA256 SHA512 personal-compress-preferences Uncompressed default-preference-list SHA256 SHA512 AES256 AES Uncompressed cert-digest-algo SHA256 s2k-cipher-algo AES256 s2k-digest-algo SHA256 s2k-mode 3 s2k-count 65011712 disable-cipher-algo 3DES weak-digest SHA1 force-mdc Note that these opti…

Thanks, I've added your info to the README and a credit to you.

Re: Using GPG to Encrypt Your Data

#89
post #8

For GPG symmetric encryption, the kind the article describes, here are the best options I've found for my typical case: gpg --symmetric \ --cipher-algo aes256 \ --digest-algo sha256 \ --cert-digest-algo sha256 \ --compress-algo none -z 0 \ --quiet --no-greeting \ --no-use-agent "$@" I keep this command here: https://github.com/SixArm/gpg-encrypt The options are chosen to balance tradeoffs of convenience, strength, an…

Does `-no-use-agent` work? I see this in man: --no-use-agent This is dummy option. gpg always requires the agent.

I'll remove it now. It was useful to have (for me) for GPG version 1 when I connected to machines via SSH and didn't want a GPG agent pop up UI, and didn't have an easy way to change the GPG agent settings.

Re: Using GPG to Encrypt Your Data

#90
post #25
post #8

For GPG symmetric encryption, the kind the article describes, here are the best options I've found for my typical case: gpg --symmetric \ --cipher-algo aes256 \ --digest-algo sha256 \ --cert-digest-algo sha256 \ --compress-algo none -z 0 \ --quiet --no-greeting \ --no-use-agent "$@" I keep this command here: https://github.com/SixArm/gpg-encrypt The options are chosen to balance tradeoffs of convenience, strength, an…

Regarding the code... set -euf onecmd --args "$@" The set -u is unneeded, as there are no code variables involved. The set -e is not needed, as there is only one command, and the script will return the exit status of such command. Always. And will exit after that command. Always. The set -f, will disable globbing, which I'm not sure it's what you want, when using a simple wrapper passing "$@" as filenames to gpg...

You're correct. I use -euf as a default for new scripts, until someone asks for relaxing these. I'll remove the -f now because you're right, globbing can be useful.
Post reply on HN