News for hackers. Stuff that matters.
Re:Show HN: Creds – manage API keys with GPG on the command ... by m6w6 on Thursday March 17, 2016 @12:21PM (#11305378)
Nice, must have been a fun project! I'm not sure, though, whether it adds enough distinct functionality to warrant a project?

Lazy version:

    $ encfs $HOME/Dropbox/creds $HOME/.creds
    $ cat >~/bin/creds <<<'EOF'
    #!/bin/sh

    $CREDS=$HOME/.creds/$2.sh

    case "$1" in
    add|edit)
        $EDITOR $CREDS
        [ -f $CREDS ] && chmod +x $CREDS
        ;;
    list)
        echo $HOME/.creds/*.sh \
            | xargs -I '{}' -n1 basename {} .sh \
            | less -SRFX
        ;;
    esac
    EOF
    $ chmod +x ~/bin/creds
EDIT: lessen <pre> width
Re:Show HN: Creds – manage API keys with GPG on the command ... by yoo1I on Thursday March 17, 2016 @11:43AM (#11305060)
This seems to be the same functionality that pass[0] offers.

[0] https://www.passwordstore.org/

Re:Show HN: Creds – manage API keys with GPG on the command ... by mrkidd on Thursday March 17, 2016 @12:46PM (#11305577)
pass doesn't have a command to directly source contents of a stored password into shell variables. But it would be great to bring that functionality from this tool into pass.
Re:Show HN: Creds – manage API keys with GPG on the command ... by irickt on Thursday March 17, 2016 @12:13PM (#11305297)
Re:Show HN: Creds – manage API keys with GPG on the command ... by bunkydoo on Thursday March 17, 2016 @01:41PM (#11306077)
Dopesauce. I always welcome a new command line tool - it's the most effective place to do things.
Re:Show HN: Creds – manage API keys with GPG on the command ... by JoelJacobson on Thursday March 17, 2016 @12:29PM (#11305426)
I wish there was an alternative to GPG or at least some bare-minimum implementation with a decent API. The only "libraries" are wrappers on top of the gpg executable.

Maybe there is an alternative that I don't know of?

Re:Show HN: Creds – manage API keys with GPG on the command ... by phunge on Thursday March 17, 2016 @02:58PM (#11306674)
Yeah this is a common complaint. I don't have direct experience with NaCL/libsodium or Keyczar but check them out. Do you mean a bitstream-compatible thing, or a GPG/PGP alternative?
Re:Show HN: Creds – manage API keys with GPG on the command ... by iheartmemcache on Thursday March 17, 2016 @06:57PM (#11308324)
libsodium is pretty GPG compatible. Diffie-Hellman key exchange function[X25519]: int crypto_scalarmult(unsigned char q, const unsigned char n, const unsigned char p);

crypto_secretbox_easy() for both encrypting + signing in the traditional public-key fashion. AES-256-GCM is there for symmetric sessions. Even OTP's are supported. I don't think there's the full PKI/WoT implementation in there, at the moment, but it's definitely sufficient to do most of the heavy lifting.

(N.b. the documentation is only like 70 pages long, read the relevant sections on: sodium_memzero(), sodium_mlock(), the notes on VMs, the notes if you have swapon, the notes on disabling coredumps, don't use malloc, use sodium_malloc() (and with that, the appropriate padding precautions should be taken if you use sodium_allocarray()), and source your entropy properly. All of this is covered in the API guide. Consult it, because I'm likely misremembering one or two things.)

Re:Show HN: Creds – manage API keys with GPG on the command ... by zokier on Thursday March 17, 2016 @03:33PM (#11306933)
Reop is not really the answer, but I think it (and NaCl with it) is the best starting point for building a GPG replacement. Of course it does not fit if you need compatibility with actual GPG for some reason.

http://www.tedunangst.com/flak/post/reop

Re:Show HN: Creds – manage API keys with GPG on the command ... by m6w6 on Thursday March 17, 2016 @12:33PM (#11305466)
Library? Do you mean something like gpgme?

https://www.gnupg.org/documentation/manuals/gpgme/

Re:Show HN: Creds – manage API keys with GPG on the command ... by JoelJacobson on Thursday March 17, 2016 @01:34PM (#11306020)
GPGME is still just a wrapper around the gpg exeutable and the source code is 961 kB (!). It's not a real "library".
Re:Show HN: Creds – manage API keys with GPG on the command ... by tristor on Thursday March 17, 2016 @01:32PM (#11306006)
GPGME is a wrapper on top of the GPG executable. It also has a horrendous API. I'm still currently fighting with it just to simply encrypt/decrypt a tarball going to S3. It's really badly designed.
Re:Show HN: Creds – manage API keys with GPG on the command ... by JoelJacobson on Thursday March 17, 2016 @01:35PM (#11306029)
I know exactly what you are going though.

Don't look at the source code of GPG, it will give you nightmares.

Re:Show HN: Creds – manage API keys with GPG on the command ... by rkeene2 on Thursday March 17, 2016 @08:25PM (#11308862)
hunter2 ( https://chiselapp.com/user/rkeene/repository/hunter2/ ) does not rely on (or even directly support) GPG. It's written in mostly Tcl with some C glue to call any PKCS#11 module. I tend to use CACKey, which talks directly to my smartcard using PC/SC from pcsc-lite and performs RSA on the card itself. Hope this helps !
Re:Show HN: Creds – manage API keys with GPG on the command ... by vdfs on Thursday March 17, 2016 @12:17PM (#11305336)
Similar tool that use asymmetric GPG encryption: https://github.com/boussouira/bash-pass