Command Line Usage

PIE (Pixel Image Encoder) 
Using the PIE Library on a command line.

Command

Here is a break down of an encode command. If you have not installed java and are using a folder containing java, use this ".your folder name/jre/bin/java -cp .....". The class path for the command is just "Pie". There are 2 class paths one for the command and one for building if you need it. The other is "net.pie.command.Start", you don't need this to run commands. More information about this is available in the coding page.

java                              (Command in the bin folder) 
-cp                               (Class Path)
.\pie-x.x.jar                     (Path to PIE Jar)
Pie                               (Class Name in the PIE library)
-encode                           (Name if the function. In this case "Encode")
-file "Path to source"            (Path to the file we are going to encode) 
-directory "Path to folder"       (Path to store the file)

Encode options. Use source file or text not both.

Parameter Usage Description Required
encode -encode Instruction value. Yes
source -file "path to file" Path to the source file you want encoded. Yes
directory -directory "path to folder" Path to the folder you want the encoded file to be stored. No
maxMB -maxMB 200 Maximum MB Encoded File. Default 500 before zipped and sliced. No
shape -shape square Sets the shape of the encoded file. No
-shape rectangle Rectangle is the default. 
mode -mode one Encoding mode one, Fully Transparent. No
-mode two Default. Encoding mode two. Semi Transparent

Encoding Text options.

Parameter Usage Description Required
source -text "some text to encode" Encode text (Only limited to the number of characters you can put onto the line) Yes
File Name -name "My_File" Can only be used when encoding text. Specifies the name of the created file. If not entered "text.txt.png" will be used. Extension ".png" will be added. When decoding the file extension ".txt" will be used.  No
Console -console Will print the text directly to the console. Very useful when testing. No

Decode options

Parameter Usage Description Required
decode -decode Instruction value. Yes
file -file "path to file" Path to the source file you want decoded. Yes
directory -directory "path to folder" Path to the folder you want the decoded file to be stored. No
prefix -prefix "Decoded_" Prefix text to the file name of the decoded file. No

Encryption options. For both encoding and decoding use encryption or certificate not both. For more information on encryption please see the "Encryption Page". Note phrases Must be over 5 characters long.

Parameter Usage Description Required
encryption -encryption "my phrase" Encryption key to encrypt and decrypt. No
certificate -certificate Path to the certificate, to encrypt and decrypt. No
Base64 version of a certificate. From V1.4+ No

Encode and Decode options

Parameter Usage Description Required
help -help Will display this blog. From 1.4+ no
prompt -prompt If your not sure what parameters to put in, use -prompt. This will prompt you for each option. No
overwrite -overwrite Overwrite the file if found. Default will not overwrite a file. No
log -log off Sets logging mode to console No
-log Information
-log Severe Default

Note
When no directory, the default is the desktop but only when using the command version of PIE. Using prompt, Will only prompt for parameters that are not used.


PIE (Pixel Image Encoder) Command Line - Encryption 
Using encryption with the PIE library is optional. Files and Text can be encoded without using encryption. There are two ways to use encryption on the command line and both are listed below.

Encoding Command Using Encryption

Using encryption phrase (Must be over 5 characters long), To decode use "-decode" instead of "-encode".
You can use any language including Arabic and Cyrillic characters.. Example phrase  عبارة سبيل المثال Пример фразы

java -cp .\pie-x.x.jar Pie -encode 
-file "Path to source" -directory "Path to folder to store file" -encryption "my phrase"

To use encryption certificate, use the following.

java -cp .\pie-x.x.jar Pie -encode 
-file "Path to source" -directory "Path to folder to store file" -certificate "Path to certificate"
or
java -cp .\pie-x.x.jar Pie -encode 
-file "Path to source" -directory "Path to folder to store file" 
-certificate "base64 string of the certificate file" <- from v1.4+

If your not sure use "-prompt" this will prompt you for the parameters. Can be used with "-encode" and "-decode".

java -cp .\pie-x.x.jar Pie -encode -prompt

Creating and Verifying certificates

Parameter Usage Description Required
make_certificate -make_certificate Used to make certificates Yes
verify_certificate -verify_certificate Used to make verify certificates Yes

To create the certificate file include "-directory"

java -cp .\pie-x.x.jar Pie -make_certificate -directory "Path to folder"
or
java -jar .\pie-x.x.jar Pie -make_certificate -directory ".\"

To create a base64 certificate use the following (V1.4+)

java -cp .\pie-x.x.jar Pie -make_certificate

Example output to the console "iVBORw0KG ... ORK5CYII=". This base64 certificate can be used with encoding and decoding.

To verify the certificate

java -cp .\pie-x.x.jar Pie -verify_certificate -file "Path to file"
or
java -cp .\pie-x.x.jar Pie -verify_certificate -base64_file "iVBORw0KGgoA...YAAAAAElFTkSuQmCC"

"-base64_file" is supported from Version 1.4+