skvdb

High-performance encrypted key-value store written in Rust.

Current release: v0.1.0 β€” Encrypted Session Foundation

skvdb is an experimental Linux-focused key-value database designed around high-performance asynchronous I/O, a custom binary wire protocol, and cryptographically protected network communication.

The current release establishes the network and cryptographic foundation. The KV protocol, encrypted application frames, WAL, and io_uring storage engine are under active development.

Status: Early development / experimental

✨ Features

Currently implemented

Planned

πŸ—οΈ Architecture

The current network architecture is:

                    TCP
                     β”‚
                     β–Ό
              Custom Framing
                     β”‚
                     β–Ό
              X25519 Handshake
                     β”‚
                     β–Ό
               Shared Secret
                     β”‚
                     β–Ό
                HKDF-SHA256
                  /       \
                 /         \
                β–Ό           β–Ό
             C2S Key      S2C Key
                β”‚           β”‚
                β””β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”˜
                      β–Ό
             ChaCha20-Poly1305
                      β”‚
                      β–Ό
              Encrypted Transport
                      β”‚
                      β–Ό
                 KV Protocol
                      β”‚
                      β–Ό
                Storage Engine
                      β”‚
                      β–Ό
                    WAL
                      β”‚
                      β–Ό
                  io_uring

The storage and encrypted application-layer transport are still under development.

πŸ” Cryptographic Design

The initial handshake uses ephemeral X25519 keys.

After the Diffie-Hellman exchange, the resulting shared secret is expanded using HKDF-SHA256 into two independent 256-bit symmetric keys:

X25519 shared secret
        β”‚
        β–Ό
   HKDF-SHA256
      /     \
     β–Ό       β–Ό
   C2S       S2C
    β”‚         β”‚
    β–Ό         β–Ό
ChaCha20   ChaCha20
Poly1305   Poly1305

Separate directional keys prevent the same key from being used for both directions of a connection.

Nonces are generated from monotonically increasing per-direction counters.

Important: The current cryptographic layer is a transport foundation, not a complete authenticated identity or production security protocol. Authentication, key confirmation, protocol version negotiation, replay semantics, and other security properties are still being designed.

πŸ“‘ Wire Protocol

The base frame header is currently:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ Opcode   β”‚ Payload Length     β”‚
β”‚ 1 byte   β”‚ 4 bytes, BE        β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”΄β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Current opcodes:

Opcode Operation
0x01 HandshakeInit
0x02 HandshakeResp
0x10 KV Get
0x11 KV Set
0x12 KV Delete
0xFF Error

The KV operations are reserved in the protocol but are not implemented yet.

πŸš€ Building

Requirements

Clone the repository:

git clone https://github.com/foxhackerzdevs/skvdb.git
cd skvdb

Build:

cargo build --release

Run:

./target/release/skvdb

The development server currently listens on:

127.0.0.1:8080

πŸ§ͺ Development

Check the project:

cargo check

Format:

cargo fmt

Build tests:

cargo test

Release build:

cargo build --release

πŸ—ΊοΈ Roadmap

Phase 1 β€” Network Foundation

Phase 2 β€” KV Protocol

Phase 3 β€” Storage Engine

Phase 4 β€” High-Performance I/O

Phase 5 β€” Linux Security

⚠️ Security Notice

skvdb is experimental software.

The cryptographic primitives are based on established algorithms and are implemented using the Rust ring library, but the overall protocol has not yet undergone a security audit.

Do not use the current development version for sensitive or production data.

Security issues should be reported privately to the maintainers whenever possible.

πŸ“ˆ Performance

Performance is a primary design goal, but benchmarks will only be published once the storage engine and encrypted request/response path are implemented.

The project aims to explore:

Performance claims will be based on reproducible benchmarks rather than assumptions.

πŸ“œ License

Licensed under the Apache License, Version 2.0.

See LICENSE for the full license text.

πŸ‘¨β€πŸ’» Author

Abhrankan Chakrabarti

Part of the Fox Hackerz project ecosystem.

Build. Break. Secure.