Skip to content

A Python library with methods to create, update and search on encrypted indices stored in a Matrix homeserver.

Notifications You must be signed in to change notification settings

BURG3R5/matrix-encrypted-search

Repository files navigation

README banner for matrix-encrypted-search

Matrix Encrypted Search

A Python library with methods to create, update and search on encrypted indices stored in content repositories in a Matrix homeserver.

GSoC '22 project with Matrix.org: Project link

Overview

The library has four main modules:

Index

index.py contains the EncryptedIndex class, which is used to convert a list of room events into a structurally encrypted index according to the aforementioned SSE scheme. The index created thusly consists of two data structures: a lookup table and a datastore.

The lookup table is a mapping from keywords to locations in the datastore where their results can be found. Meanwhile, the datastore is a multi-dimensional array which contains random batches of event ids for events in which the keywords occur.

Storage

storage.py contains the IndexStorage class, which is used to transform the single massive datastore into smaller blobs that can be stored as files on a Matrix homeserver. It exposes an iterator for the client to store the blobs on the server and then updates the lookup table of the index to point to remote locations using the MXC URIs instead of local array positions.

Merge

merge.py contains the IndexMerge class, which is used to merge two or more remote encrypted indices. It exposes an iterator for the client to fetch data blobs from one or more homeservers and merges them into a new encrypted index.

Search

search.py contains the EncryptedSearch class, which is used to search for a query across one or more encrypted indices at once. It performs this operation in two steps: First identifying the files to be fetched, then locating the relevant chunks within those files.

About

A Python library with methods to create, update and search on encrypted indices stored in a Matrix homeserver.

Topics

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages