This program is used to generate encrypted key pairs and enable encryption/decryption for files based on PGP encryption algorithm.
Different parameters need to be passed in for different scenarios, below are the examples:
java -DGEN_KEY_PAIR=1 -DENCRYPTION=0 -DDECRYPTION=0 -DID= -DPWD= -DGEN_PRIV_KEY=/ -DGEN_PUB_KEY=/ -jar
java -DGEN_KEY_PAIR=0 -DENCRYPTION=1 -DDECRYPTION=0 -DEXISTPUBKEYFILE=/ -DCIPHEREDFILEOUTPUT=/ -DORIGINALFILEINPUT=/ -jar
java -DGEN_KEY_PAIR=0 -DENCRYPTION=1 -DDECRYPTION=0 -DEXISTPUBKEYFILE=/ -DORIGINALFILEINPUT=/,/ -jar
java -DGEN_KEY_PAIR=0 -DENCRYPTION=1 -DDECRYPTION=0 -DEXISTPUBKEYFILE=/ -DCIPHERDIR= -DCIPHEROUTPUTDIR= -jar PGP_Encryption-1.0-SNAPSHOT-pkg.jar
java -DGEN_KEY_PAIR=0 -DENCRYPTION=0 -DDECRYPTION=1 -DPWD= -DCIPHEREDFILEINPUT=/ -DDECRYPTEDFILEOUTPUT=/ -DPRIVATEKEYFILE=/ -jar '
The jar file is located in /target/PGP_Encryption-1.0-SNAPSHOT-pkg.jar
As for summary, below are all the parameters used for the program
- 0: skip generating key pairs
- 1: generate key pairs
- 0: skip encryption
- 1: do encryption
- 0: skip decryption
- 1: do decryption
- ID used to generate a new public key
- Password to generate a new private key
- Password to decrypt an existing private key
- target directory and file name for the private key
- target directory and file name for the public key
- source directory to be encrypted: all files in the directory will be encrypted, if no output directory is named, then will create encrypted file in the same location
- output directory of the encryption when encrypting the whole directory
- existed public key file to be used for encryption
- encrypted file as output
- original file to be encrypted
- encrypted file to be deciphered
- private key file used for decryption
- output file after decryption