Skip to content

Latest commit

 

History

History
65 lines (52 loc) · 1.75 KB

README.md

File metadata and controls

65 lines (52 loc) · 1.75 KB

EStore

EStore is a key-value store with authenticated encryption for data at rest. It's based on Pebble, the key-value store used in CockroachDB. EStore provides confidentiality and integrity for the database state as a whole. We call this "snapshot integrity." In contrast, other database encryption schemes typically only provide integrity at the record or file level. As a result, in those cases, attackers can modify parts of the database state unnoticed.

With these properties, EStore is particularly well suited for use with EGo to build confidential-computing apps. However, you can use EStore in any Go application to store sensitive information in a structured way.

Example

package main

import (
	"crypto/rand"
	"fmt"
	"log"

	"github.com/edgelesssys/estore"
)

func main() {
	// Generate an encryption key
	encryptionKey := make([]byte, 16)
	_, err := rand.Read(encryptionKey)
	if err != nil {
		log.Fatal(err)
	}

	// Create an encrypted store
	opts := &estore.Options{
		EncryptionKey: encryptionKey,
	}
	db, err := estore.Open("demo", opts)
	if err != nil {
		log.Fatal(err)
	}
	defer db.Close()

	// Set a key-value pair
	key := []byte("hello")
	if err := db.Set(key, []byte("world"), nil); err != nil {
		log.Fatal(err)
	}

	// Get the value of the key
	value, closer, err := db.Get(key)
	if err != nil {
		log.Fatal(err)
	}
	defer closer.Close()
	fmt.Printf("%s %s\n", key, value)
}

License

EStore is licensed under AGPL-3.0. It uses code licensed under a BSD-style license.

You can also get a commercial license and enterprise support.