A way of encryption through the programming of keys.
KEE is a joke turned real project. Originally I wanted to have my own cipher system (similar to a caesar cipher) for some of my friends, but then I moved on to ciphering on a binary level, and it became more of an encryption system. After a bit of back-and-forth messaging, I decided to actually make an encryption system and language.
It works by writing whatever you feel is complicated in XKEE (the more you write the better), and then compiling it into the KEE format. With this key, you can start encrypting files, like images, documents, or plain text files. You can then decrypt those files with the same key.
Warning
I believe XKEE is the first of its kind, a language specifically for writing ways to encrypt something. Please let me know if this has been done before, I would be very interested to hear about more of these!
Note
I'm currently looking for a way to turn this into an executable. This might require a rewrite in another language, like Rust. That way it also won't require to install Python 3 and the libraries used.
Note
If you find it more convenient, make sure to add Python, kee.py
, and xkee.py
to PATH. I'm thinking about making an installation script to do this automatically.
-
Download the latest releases of
kee.py
(optionally alsoxkee.py
) and put them somewhere you'll remember (e.g.Documents
). -
Done!
This section will explain every feature of KEE and XKEY, if you want to skip to certain parts, look here!
The recommended option is to copy the file to encrypt into the same folder as the KEE scripts, but you can also use other ways to run the scripts, it doesn't really matter. Make sure you directly run the script like kee.py
(or .\kee.py
for PS).
Let's say we have an example file, my_file.txt
, and it contains the following content:
My day has been going great!
Warning
I am not showing an example of the key used here so that nobody encrypts their files with publicly accessible keys. Please use your own, private, keys in this example.
We can now encrypt our text file with a key called my_key.kee
!
kee.py my_file.txt my_key.kee en
Note
en
can be replaced with de
to decrypt the file back to its original state.
XKEE is the encryption language that keys are written in. It's a slightly enhanced, plain-text version of the HEX "KEE" format. It compiles to .kee
, which then can be used for encryption. XKEE looks similar to assembly, but there are differences that we'll talk about in a bit.
The syntax for XKEE is pretty basic, easy to learn, and easy to understand, even for beginner programmers.
Every line is formatted like a variation of the following syntax:
Sometimes, there aren't any arguments required at all
Instructions like this often use separate variables for modification.
Of course, you're also able to write comments. They aren't really complex and don't support being inline with another instruction. This serves well enough for most stuff you want to write down, anyway.
Some instructions make use of 2-4 variables for modification, as mentioned above, the syntax for them is formatted like:
These are NOT compiled. They exist purely to make the syntax simpler. They are the only instruction that can also be used as an argument at the same time.
Whenever a byte exceeds 0xff
, it loops back around to 0x00
LGD
: Calculates a linear number gradient between the variableshx0
andhx1
, then, every byte gets the number for its position added to itself.GRD
: Calculates a number gradient between the variableshx0
,hx1
,hx2
, andhx3
, then, every byte gets the number for its position added to itself.ADD
: Adds a number to each byte.SUB
: Subtracts a number from each byte.
TSP
: The current timestamp modulo 256 to fit within a single byte. This may be changed in the future. This instruction exists to make replicating a key from source code more difficult.RND
: A random number from0x00
to0xff
. This instruction exists to make replicating a key from source code more difficult.
Once you're done writing your key, you can compile it with the following command:
xkee.py my_key.xkee
Optionally, you can define a name for the compiled key:
xkee.py my_key.xkee cool_key.kee
If you have any issues when compiling, please report them as an issue! I will try to do my best and fix these issues ASAP.
TheZoidMaster made a fork of KEE for usage as a Python library! Please use that project for embedding KEE in your personal projects! You can check it out here!
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.