Re: password protection of a file

From: Eddy (provisoire.jan2005_at_belgacom.net)
Date: 01/16/05

  • Next message: Peter Nuttall: "Re: password protection of a file"
    Date: Sun, 16 Jan 2005 17:06:14 +0100
    To: debian-user@lists.debian.org
    
    

    Flo a écrit le 16/01/05 13:25 :
    > thanx a lot,
    >
    > the trouble is that i want to use the command into a script.
    > Unfortunately gpg -c and zip -e ask for an user input for the password :-(

    At least, zip with options -e and -P (I think) can do that.
    Take a look at man zip.
    But others have told you how weak zip's encryption is.

    As far as gpg is concerned, I just got this idea by reading man gpg.
    I don't know if there is any easier way.

    Suppose you want to encrypt the file named "secret.txt" with passphrase
    "nobody knows this" you can do
            echo nobody knows this | gpg -c --passphrase-fd 0 secret.txt
    this will create a file "secret.txt.gpg"

    To decrypt it into a file named "secret2.txt" you can do
            echo nobody knows this | gpg --passphrase-fd 0
            -o secret2.txt -d secret.txt.gpg
    (all in one single line of course).

    Of course, having the password written in the script file is totally
    unsecure; I think encrypting a file in such a way is totally pointless.
    Really I can't think of a single reason to do it.
    (If you have one, I'm curious to know !)

    On the other hand, having the script prompt you for the password that
    you would put in a variable and use it in something like
            echo "$varpass" | gpg -c --passphrase-fd 0 "$file"
    could be a way to encrypt many files without the need to enter the
    password for each of them.

    Beware that I am no specialist of these matters !

    -- 
    Eddy
              "La notion de passoire est indépendante de la notion de trou."
    		                                 Les Shadoks
    -- 
    To UNSUBSCRIBE, email to debian-user-REQUEST@lists.debian.org 
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
    

  • Next message: Peter Nuttall: "Re: password protection of a file"

    Relevant Pages

    • RE: Changing local admin PW using vb logon script - can it be encrypted?
      ... If you really want to get carried away encrypt the password in the registry, but the code to decrypt must be added to the script. ... Subject: Re: Changing local admin PW using vb logon script - can it be encrypted? ...
      (Focus-Microsoft)
    • Command line input and validation - Bourne shell
      ... Write a Bourne shell script called caesar.sh to encrypt plaintext into ... The Caesar cipher is based on a cyclic ... We only encrypt the alphabetical characters. ... If there is only one command line parameter, ...
      (comp.unix.shell)
    • Re: Encrypted password in script
      ... I am writing a script which will change the password of the local ... the possibility to encode the script through the Microsoft encode utility, ... Why cant you use the built in XP File Encryption to encrypt ... Just in case you are not aware of how to encrypt a file, from Explorer, ...
      (microsoft.public.scripting.wsh)
    • Re: insert into a db...
      ... While we must encrypt all data that is ... >> from the browser to the server when it is anything remotely customer ... I assume that you'll be using VB Script as your ASP ...
      (microsoft.public.inetserver.asp.general)
    • Re: insert into a db...
      ... While we must encrypt all data that is ... >> from the browser to the server when it is anything remotely customer ... I assume that you'll be using VB Script as your ASP ...
      (microsoft.public.inetserver.asp.db)