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:

  1. Scalable & Flexible

  2. Stable & Resilient

  3. Portable & Tiny

  4. Relatively Fast to Read & Write

  5. Hierarchical & Structured

  6. 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

  1. 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.

  2. Next, we encrypt using Fernet, a modern encryption scheme that only uses an extra 73 bytes to encrypt.

  3. 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

  1. We verify the signage of the file, making sure the file wasn't tampered with by an outside force.

  2. Second, we decrypt the file, and if decryption fails, we throw an error.

  3. 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