1. Principles
2. Usage
3. Examples
4. Other Notes
As this is not my area, I will instead refer you to a page on XOR encryption that I found while doing my own research in this area. It is located at http://www.yoe.org/developer/xor.html and details the principles behind XOR encryption.
The command line switches are as follows.
-i | Input String |
-if | Input File |
-of | Output File (If not specified, output will be printed to screen) |
-k | Key String |
-kf | Key File |
-kl | Key Length - Default is 16 (Somewhat secure) |
Please note that either -i or -if must be specified, but not both. Also, not more than one of -k, -kf, or -kl can be specified.
If you do not specify a key or a key file, one will be produced randomly. You can specify how long you want this random key to be by using -kl or you can simply not specify -kl and the program will make a random 16 character key. Also, if you specify -if or -kf, and the program cannot open the appropriate file, it will assume you meant to specify -i or -k, respectively, and it will procede accordingly.
This program is used from the command line by following the program name with whatever arguments you want to use in any order. Be sure to leave a space between the argument and the value. If any argument value has spaces, you need to put in in a separate file and then specify the file with -if.
For examples, see the next section.
Input | (Potential) Output |
xorcrypt -i sampleinputtext -k key1 -of crypt.txt |
[No output] |
xorcrypt -if crypt.txt -k key1 | Output: sampleinputtext |
xorcrypt -i sample -k thekey | Output: [strange characters] |
xorcrypt -i sampletexttoencrypt | Key: UbFM08ltXeIP3Bow Output: [strange characters] |
xorcrypt -i sampletexttoencrypt -kl 7 | Key: 9YxMlAZ Output: [strange characters] |
You should get the idea.
Feel free to email me at if you find any bugs or have any suggestions, comments, or anything else you'd like me to know.
All code in this program is freely distributable and modifyable as long as it is not sold in any way. In addition, I shall not be held liable in the unlikely event that my program causes harm to your computer. Other than that, have fun!