swasun / LibSecureStorage

C library to store data or multiple files in an encrypted single-file storage.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Description

C library to store data or multiple files in an encrypted single-file storage.

API

Example of use of API without error handling for sake of simplicity. For a detailed example, see examples folder.

Create entries

sstorage_entry *first = sstorage_entry_create(<DATA_TYPE_INTEGER>);
sstorage_entry_add_string(first, "Hello world !");

// write first entry
sstorage_entry_destroy(first);

sstorage_entry *second = sstorage_entry_create(<DATA_TYPE_INTEGER>);
sstorage_entry_add_file(second, "data.bin");

// write second entry
sstorage_entry_destroy(second);

Write entries to storage

sstorage *storage = sstorage_open_write("example.sst", <crypto_metadata>);

sstorage_push_entry(storage, first);
sstorage_push_entry(storage, second);

sstorage_close(storage);

Read an entry from storage

sstorage *storage = sstorage_open_read("example.sst", <crypto_metadata>);

if (!sstorage_has_next(storage)) {
    <error_handling>
}

entry = sstorage_next(storage);

sstorage_close(storage);

Dependencies

Cross-plateform

Tested on Windows 64, but it should also work on Windows x86 and Linux.

About

C library to store data or multiple files in an encrypted single-file storage.

License:Apache License 2.0


Languages

Language:C 88.7%Language:C++ 10.2%Language:CMake 0.9%Language:Objective-C 0.1%Language:Shell 0.0%