SKit
This page goes over the file format created for Reyveld.
SKit, short for SERE kit, is a file format that I created for Reyveld that makes it easy to encapsulate all of the data required for the program.
Why do they exist?
SKit was created to be a universal file format for Reyveld. I did not want to have multiple formats to store data in Reyveld, especially when new logic must be made to save and load those files. So, SKit seek to solve that by being both a database and archive in one. The main goals of SKit was to be:
Scalable & Flexible
Stable & Resilient
Portable & Tiny
Relatively Fast to Read & Write
Hierarchical & Structured
Trustworthy & Secure
How they work.
To make SKit scalable and hierarchical, we save everything as XML. The reason I chose XML is because I can use XML tags to automatically load data with a interface for that chunk of data, unlike JSON. While I could have made my own data format, I decided against it, as XML is more than sufficient for what I am looking for.
SKit divides its data into 65536 bytes (or 64KB) before compressing, encrypting, and signing into individual chunks.
Writing
We first compress the pure XML using GZip. I chose GZip to be our compression technique, as it's one of the most efficient and lossless compression algorithms in the world, and Dart already has functions to compress data with it.
Next, we encrypt using Fernet, a modern encryption scheme that only uses an extra 73 bytes to encrypt.
Then finally, we sign the SKit file using RSA, which is asymmetric in nature. It uses a private key that signs the data, and a public key to verify that the data hasn't been tampered with.
Reading
We verify the signage of the file, making sure the file wasn't tampered with by an outside force.
Second, we decrypt the file, and if decryption fails, we throw an error.
Lastly, we decompress the file.
Header & Roots
A SKit structure starts with a SHeader, a node that contains information about the SKit. SHeader can contain small nodes like:
Constellation
Star
SDescription
SRAuthor, SRArchive, and SRFile.
The rest of the file contains larger XML nodes, known as roots. These roots have a unique hash, and contains data that do not need to be immediately loaded into memory. This includes:
STag
SArchive
SUser
SAuthor
Last updated