About

Xenone

About

I created this project after learning how to use bitwise operations in java. Here's how it works:

  1. First, the program takes a letter, word, or phrase; and a password, which can be any length and made up of any symbols.
  2. The program divides the password into individual letters, and then puts them in an array. Each letter is broken down into their ASCII number equivalents.
  3. Each letter in the text to be encoded is broken down like the password.
  4. Then, the letter is masked by each letter in the password array, using a bitwise operator:

int n = 25; //n is a character from the text
int[] mask; //there is more code behind this, but imagine this contains the password
for(int i:mask)
{
n = n^i; //more about this later
n = ~n; //This flips every 1 to a 0 and every 0 to a 1
}

  1. So here's how the mask works:
    • Each number can be written in an 8-bit binary code.
    • For this example we will use these two codes: 00011001 and 11000101.
    • Simple version: The digits in the first code are masked over the second code and some numbers stay the same, and some change.
    • Complex version. Take each digit individually. If the second binary's digit is 0, the first binary's digit stays the same.
    • If the second binary's digit is 1, then the first binary's digit flips (0 to 1 or 1 to 0).
    • The way the code is set up, the text is masked by each character in the password, read forward to encode, backward to decode.
    • You could technically encode the text twice and flip the password around to get back to the original text.
  2. So that's how it works. There are still some bugs and incompatibilities:
    1. It only works with directly inputed text, not a file.
    2. Sometimes, a letter will encode to a null type, which means a letter will be left out depending on what password you are using.
    3. I would only assume that for every password, there are an infinite amount of passwords that can be used to decode the message, because the masking process could include redundancies, like two letters that are the same.
  3. The upside is that without the password, the code is unbreakable. Of course, a computer can randomly generate a password and guess its way into the program, but depending on the length of your password, this could take a while.

Usage

Open up your computer's command line (you might also be able to just run the jar automatically). Then navigate to the directory in which you installed the jar. On a Mac/Linux, type "cd" and then drag the file into the command line window (then press return). Same command for PC, but I don't know whether you can drag the file. If you can't, just type in the file path after "cd". Once you are in the directory, type "java -jar TextCoder.jar" without quotes. This will run the jar.

OR

Just double click the jar file...

Once you have the jar running, type text to encode/decode on the left, then the password under it, and press either the "encode" or "decode" button.

Instructions


Related

Home: Home
Wiki: Home

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.