|
cGeep Command Line
1 Launching cGeep Command Line Tool
The syntax of the command line tool is: cgeep <options> <parameters>
The Help is displayed when launching cgeep without any parameters:
Usage: cgeep -b,--detach-sign <file> <user_id> [<signature_file>] Create a detached signature of file -c,--symmetric Use symmetric encryption (to be used with -e) -d,--decrypt <file> [<user_id>] Decrypt file --delete-keys <user_id> Delete key --directory <directory> Directory of keyring -e,--encrypt <file> [<destination_file>] Encrypt file --export <user_id> [<destination_file>] Export a key in armored format --gen-key Generate a key pair --gen-revoke <user_id> <user_id_private> Revoke a key --list-keys <substring> List keys in keyring -h Print this message -o,--output <file> Output file -p,--passphrase Passphrase to use -r,--recipient <user_id> User id of recipient --recv-keys <server> <user_id> Receive a key from a remote HKP server --search-keys <server> <substring> Search a key on a remote HKP server --send-keys <server> <user_id> Send a key to a remote HKP server --sign-key <user_id> <user_id_private> Sign a key --verify <file> [<signature_file>] Verify detached signature -v, --version Display version number of cGeep
2 Keys Management Examples
2.1 Key Creation
$ cgeep --gen-key Select what kind of key you want (default is 2): 1 DSA/Elgamal 2 RSA Please choose 1 or 2: 2 Please give the key size you want (default 2048): Valid sizes are multiples of 1024 1024 When do you want your key to expire? yy/mm/dd or NEVER (default is NEVER): NEVER Name: test Email: test@test.com Enter passphrase:
Repeat passphrase:
Please choose the Symmetric key type: 0 : CAST-128 1 : Blowfish-128 2 : AES-128 3 : AES-192 4 : AES-256 5 : 3DES-168 Your choice (default is 4): 4 Key pair generated.
Notes:
The –directory option can be specified at each cgeep call to precise the directory that contains the keyring.
If not specified, the keyring is contained in the directory defined by the java "user.home" property and/or the PWD environment property.
2.2 Key Search
$ cgeep --list-keys test.com pub 1024/C98D440B 2009-10-27 uid test<test@test.com>
2.3 key Export
$ cgeep --export test@test.com test@test.com.asc Key successfully exported to /home/admin/test@test.com.asc.
Notes:
2.4 key Import
$ cgeep --import /home/admin/ndepomereu\@safelogic.com.asc
-----BEGIN PGP PUBLIC KEY BLOCK----- Version : cGeep v3.21a – Easy Encryption for All
mI0ERGBxggMEANIUnXxmxgdskJqcHImdnMiIdH3IH5QlXnDK7I0u2Rsjzpj3TGke lnXMBGMxPQsm0mBKyHFAdUXANtZVB6splFbeG6/CEEh0QZtrq5I4V0iRpt37hD/t 7JxmVEV4I4mXfbl4QmAaGzDuaubsTxU4lxxa7brfVbsuuJJ3PA7iAHyxABEBAAG0 LU5pY29sYXMgZGUgUG9tZXJldSA8bmRlcG9tZXJldUBzYWZlbG9naWMuY29tPoic BBMDAgAQBQJEYHGECRCcinZbTU/CTwAA13gD/iTA/DONfBFjZpLMphSq7OyCmkDn 4eY/uj8k31eyb4fb2dGRmu1O1noBt7v4KproYRMpB15EfPYxoIWf9MlhlUORA0SI iCPqrtPOGGiB0UHo2KCunIQqbPh10rrRsrI+YjW05tSgJ3QhZfgiEE9nWlepsdUh t83pC9EzaZEKvBrHuI0ERGBxggIEAI6AErXYaW7E2D5BZQ51yAxobO4W9r5k1QsG SGY/TwYRxw3nS8bVTsE3rYGaaktck5nW/hjaXqURCmU7n7aFsfo8RDioC8+oXLPS sJ/13GVjoe9ObmZ8lVU0abPkdJlSozejwxfggX5WsIU3lxISuIxMMu9aA6rjqGOQ l/my9V7bABEBAAGInAQYAwIAEAUCRGBxhAkQnIp2W01Pwk8AAFNYA/9yhZ5JXM3S qJcJJ9DRa+2eGTlwLvF3PSnLT+zOLFM4/TJGdY2iwViG96vgNqa2pYmpdswxA4RK N+lhhXLrgPS3f9TPeadCf2i086kVJtFmpPOIndYGZM9zyMj9bO1NhjesI2FBDnxA WD6jEkdhll8jZ1uecgiswKiyG3cWhq1pPg== =ULh8 -----END PGP PUBLIC KEY BLOCK-----
Key successfully imported.
2.5 Key Revocation
$ cgeep --gen-revoke ndepomereu@safelogic.com test@test.com Enter passphrase for user id test@test.com:
-----BEGIN PGP PUBLIC KEY BLOCK----- Version: BCPG v1.42
mI0ERGBxggMEANIUnXxmxgdskJqcHImdnMiIdH3IH5QlXnDK7I0u2Rsjzpj3TGke lnXMBGMxPQsm0mBKyHFAdUXANtZVB6splFbeG6/CEEh0QZtrq5I4V0iRpt37hD/t 7JxmVEV4I4mXfbl4QmAaGzDuaubsTxU4lxxa7brfVbsuuJJ3PA7iAHyxABEBAAG0 LU5pY29sYXMgZGUgUG9tZXJldSA8bmRlcG9tZXJldUBzYWZlbG9naWMuY29tPoic BBMDAgAQBQJEYHGECRCcinZbTU/CTwAA13gD/iTA/DONfBFjZpLMphSq7OyCmkDn 4eY/uj8k31eyb4fb2dGRmu1O1noBt7v4KproYRMpB15EfPYxoIWf9MlhlUORA0SI iCPqrtPOGGiB0UHo2KCunIQqbPh10rrRsrI+YjW05tSgJ3QhZfgiEE9nWlepsdUh t83pC9EzaZEKvBrHuI0ERGBxggIEAI6AErXYaW7E2D5BZQ51yAxobO4W9r5k1QsG SGY/TwYRxw3nS8bVTsE3rYGaaktck5nW/hjaXqURCmU7n7aFsfo8RDioC8+oXLPS sJ/13GVjoe9ObmZ8lVU0abPkdJlSozejwxfggX5WsIU3lxISuIxMMu9aA6rjqGOQ l/my9V7bABEBAAGInAQYAwIAEAUCRGBxhAkQnIp2W01Pwk8AAFNYA/9yhZ5JXM3S qJcJJ9DRa+2eGTlwLvF3PSnLT+zOLFM4/TJGdY2iwViG96vgNqa2pYmpdswxA4RK N+lhhXLrgPS3f9TPeadCf2i086kVJtFmpPOIndYGZM9zyMj9bO1NhjesI2FBDnxA WD6jEkdhll8jZ1uecgiswKiyG3cWhq1pPg== =ULh8 -----END PGP PUBLIC KEY BLOCK-----
Key revoked.
2.6 Delete Key
$ cgeep --delete-keys ndepomereu@safelogic.com Key deleted.
2.7 Key Signing
$ cgeep --sign-key ndepomereu@safelogic.com test@test.com -p passphrase -----BEGIN PGP PUBLIC KEY BLOCK----- Version: BCPG v1.42
mI0ERGBxggMEANIUnXxmxgdskJqcHImdnMiIdH3IH5QlXnDK7I0u2Rsjzpj3TGke lnXMBGMxPQsm0mBKyHFAdUXANtZVB6splFbeG6/CEEh0QZtrq5I4V0iRpt37hD/t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tL9we5ruk5Meq4MjpdyI+byiWM34b5Ud+im+QaKY8Y9jO9ZGT28KK/d1vYDR duQyaMBvMvMWgieTIkDwqkakVA6X/DmajF30HzPJ1LykkEecnA== =Sizv -----END PGP PUBLIC KEY BLOCK-----
Key signed.
2.8 Search a Key on a Key Server
$ cgeep --search-keys http://pgp.mit.edu:11371 safelogic info:1:19 pub:FDA2D445:3:1024:1242309984::r uid:Nico de Pomereu (TEST) <nico@safelogic.com>:1242309984:: pub:E99F01F6:17:1024:1236020236:: uid:Nico de Pomereu <nico@safelogic.com>:1236020236:: pub:6FD9A327:3:2048:1206524922:: uid:Nico de Pomereu (TEST) <nico@safelogic.com>:1206524922:: pub:4D4FC24F:3:1024:1147171202:: uid:Nicolas de Pomereu <ndepomereu@safelogic.com>:1238966180:: uat:::: pub:5F85FAAE:3:1024:1146755474:: uid:Alexandre BECQUEREAU <abecquereau@safelogic.com>:1146755476:: uat::::
Notes:
The output format is in "mr" type (Machine Readable) as defined by the OpenPGP HTTP Keyserver Protocol. (See http://tools.ietf.org/html/draft-shaw-openpgp-hkp-00.)
2.9 Send a Key to a Key Server
$ --send-keys http://pgp.mit.edu:11371 alexTEST@safelogic.com --directory c:\temp
Key sent.
2.10Receive a Key from a Key Server
$ cgeep --recv-keys http://pgp.mit.edu:11371 ndepomereu@safelogic.com -o ¶ /home/admin/test_api/ndepomereu@safelogic.com.asc
The Key bloc is saved in the file ndepomereu@safelogic.com.asc in armor format.
3 Symmetric Encryption Examples
3.1 File Encryption
$ cgeep -e -c /home/admin/test_api/test.txt Enter password:
Repeat password:
File encrypted to /home/admin/test_api/test.txt.pgp.
3.2 File Decryption
$ cgeep -d /home/admin/test_api/test.txt.pgp -p password /home/admin/test_api/test.txt.pgp File decrypted to: /home/admin/test_api/test.txt.
Notes:
4 Asymmetric Encryption Examples
4.1 File Encryption
$ cgeep -e /home/admin/test_api/test.txt -r test@test.com File encrypted to /home/admin/test_api/test.txt.pgp.
4.2 File Decryption
$ cgeep -d /home/admin/test_api/test.txt.pgp test@test.com -p passphrase /home/admin/test_api/test.txt.pgp File decrypted to: /home/admin/test_api/test.txt.
5 File Signature Examples
5.1 Sign File
$ cgeep -b /home/admin/test_api/test.txt test@test.com -p passphrase File signed in /home/admin/test_api/test.txt.sig.
5.2 Verify File Signature
$ cgeep --verify /home/admin/test_api/test.txt /home/admin/test_api/test.txt.sig Signature successfully verified. |