Thread: gpg save passphrase

  1. #1
    Registered User
    Join Date
    Jul 2022
    Posts
    3

    gpg save passphrase

    I have installed manually gpg version 2.2.27 ,download it from https://www.gnupg.org/ftp/gcrypt/gnu...2.2.27.tar.bz2
    followed the steps to install all the libraries , used ./configure && make.
    Generated keys with gpg --gen-key
    Everything works fine.
    I have setup up the passphrase .
    When i use it on a file like :

    gpg -d file.gpg it opens the next popup .

    lqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqk
    x Please enter the passphrase to unlock the secret key for the OpenPGP certificate: x
    x "john smith (admin support) <[email protected]>" x
    x 2048-bit RSA key, ID 4DDF05FC, x
    x created 2022-07-02 (main key ID 1274E5D3). x
    x x
    x x
    x Passphrase **********________________________________________ _____________________ x
    x x
    x <OK> <Cancel> x
    mqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqj


    After i type in the passphrase i want to save the passphrase in a file for further testing.
    Can`t seem to find how passphrase is send from the popup.
    From the documentation :
    g10/passphrase.c
    Passphrase handling code
    g10/gpg.c
    Main module with option parsing and all the stuff you have to do on startup. Also has the exit handler and some helper functions.

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    Why don't you pass the passphrase on the command line to begin with, if you want the passphrase in a file.
    --passphrase-file file
    Read the passphrase from file file. Only the first line will be read from file file. This can only be used if only one passphrase is supplied. Obviously, a
    passphrase stored in a file is of questionable security if other users can read this file. Don't use this option if you can avoid it.

    Note that since Version 2.0 this passphrase is only used if the option --batch has also been given. Since Version 2.1 the --pinentry-mode also needs to be set to
    loopback.

    --passphrase string
    Use string as the passphrase. This can only be used if only one passphrase is supplied. Obviously, this is of very questionable security on a multi-user system.
    Don't use this option if you can avoid it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  3. #3
    Registered User
    Join Date
    Jul 2022
    Posts
    3
    Thanks for the quick reply Salem.
    I know these options , but for multi-user system is not that good .I wanted to know how the passphrase is passed from the popup after i press <Ok> .
    From documentation : g10/passphrase.c
    Passphrase handling code
    But can`t seem to find out how the passphrase it`s processed from the popup to passphrase.c .
    Thanks in advance.

  4. #4
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > but for multi-user system is not that good
    Sorry, this just seems like an attempt to steal everyone else's credentials.

    > After i type in the passphrase i want to save the passphrase in a file for further testing.
    Or your incompetence with the resulting file will just compromise everyone else's security.

    "for testing" with your own keys, the existing command line options are more than sufficient.

    Otherwise, it's just got red flags all over it.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  5. #5
    Registered User
    Join Date
    Jul 2022
    Posts
    3
    Yes you are right Salem , it`s better with --passphrase-file.
    Thanks for the reply.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 0
    Last Post: 09-27-2016, 01:45 PM
  2. Passphrase-Protecting a File
    By QuadraticFighte in forum Tech Board
    Replies: 2
    Last Post: 10-18-2011, 08:11 AM
  3. Save vs Save As.... OPENFILENAME flags
    By csonx_p in forum Windows Programming
    Replies: 16
    Last Post: 06-01-2008, 02:42 PM
  4. save webpage? some save some not
    By kryptkat in forum Tech Board
    Replies: 3
    Last Post: 06-07-2005, 09:21 AM

Tags for this Thread