Link to home
Start Free TrialLog in
Avatar of Sara_j_11
Sara_j_11

asked on

pgp

Please take a look at https://www.experts-exchange.com/questions/21820017/shell-or-pgp.html

even though it says vb , we are actaully trying to figure out command line pgp..
Avatar of Sara_j_11
Sara_j_11

ASKER

basically I am trying to do this:
 pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force
It still asks me the question that prompts me to enter y/n ( are you sure that u want to use this public key y/n)
and then I have to answer y and then it produces the encrypted file for me. But I want to automate that script so that I do not have to go to c: everytime I want to encrypt the file. so I want to bypass that question (y/n). How do I do this? I thoughht the +force would solve the problem...

echo y| pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force

That should do it!  Also, the "y" can be replaced with whatever key you're trying to simulate.

Good luck,
Pano
do you mean type the above mentioned:
echo y| pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force

in the command prompt.. I tried that , but it does not work... Also what do you mean by : "y" can be replaced with whatever key you're trying to simulate.
does that mean i have to do:
echo DOH_PGP_KEY | pgp –s c:\test.txt –e DOH_PGP_KEY -z "my passphrase sentence" +force
I tried both , but does not work..



it still asks me that question:
WARNING: Because this public key is not certified with a trusted signature , it is not known with high confidence that it actually belongs to DOH_PGP_KEY(email_id)
Are you sure you want to use this public key(y/N)?
At that point if I pick y , it creates the file, but how do i make it accept it by default
HOW TO MAKE SURE THAT :  the key is signed/certified ?
ok I did the following and now it works in command line..
There are 2 steps that I followed:
1) You should change trust parametesrparameters for someone's public key (pgp -ke)
2) Than you should sign this public key with yours (pgp -ks)

Now if i go to command prompt(C:\Program Files\Network Associates\PGPcmdln) and type
pgp –s test.txt –e DOH_PGP_KEY -z  "mypassphrase"

But I dont want to go to the command prompt every time to type this , insteas I want to create a batch file that I can double clcik.
I opened notepad and typed
c:
cd C:\Program Files\Network Associates\PGPcmdln
pgp –s test.txt –e DOH_PGP_KEY -z  "mypassphrase"

and saved it as batch.bat . But wehn I click on it it does not create the encrypted file , but it works if i do the same thing in the command prompt manually... Can you please help with this?
ok I finally got the batch file to work
ASKER CERTIFIED SOLUTION
Avatar of CetusMOD
CetusMOD
Flag of Netherlands image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial