libsodium_dart_bindings
libsodium_dart_bindings copied to clipboard
Secret stream state initialization; Continue interrupted upload of encrypted stream;
Secret stream documentation: https://libsodium.gitbook.io/doc/secret-key_cryptography/secretstream says: "Since the length of the stream is not limited, it can also be used to encrypt files regardless of their size."
In order to reliably upload multiple GB over the HTTP it is safe to assume that this will take a while, connection might drop or even system might crash over the period of hours / days.
I am looking for a way to start secretstream
encryption from last saved checkpoint before failure took place.
In C API I believe that state is kept externally and can always be restored if needed e.g.
crypto_secretstream_xchacha20poly1305_state state;
crypto_secretstream_xchacha20poly1305_init_push(&state, header, key);
In Dart bindings I've found comment in the: secret_stream.dart
:
/// Unlike the C API, which requires manual state management etc., this API
/// combines all the required parts into a single, simple dart stream. As a
/// first step, crypto_secretstream_xchacha20poly1305_init_push is used to
/// generate the stream state from the [key] and the created header is sent
/// as the first message of the returned [SecretExStream].
Is it possible to initialize state manually with libsodium_dart_bindings
in order to start encryption stream from a certain point?