• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

.github/H09-Mar-2020-10665

sioutil/H09-Mar-2020-14966

.cirrus.ymlH A D09-Mar-2020521 1915

.gitignoreH A D09-Mar-2020192 1310

.golangci.ymlH A D09-Mar-2020517 3126

LICENSEH A D09-Mar-20201 KiB2217

README.mdH A D09-Mar-20202 KiB3828

benchmark_test.goH A D09-Mar-20208.4 KiB282248

examples_test.goH A D09-Mar-202010.3 KiB285140

fuzz-corpus.shH A D09-Mar-2020694 2216

fuzz.goH A D09-Mar-202010.2 KiB411349

fuzzbuzz.yamlH A D09-Mar-2020290 1513

go.modH A D09-Mar-2020166 96

go.sumH A D09-Mar-2020931 109

helper_test.goH A D09-Mar-20202.1 KiB10792

reader.goH A D09-Mar-202012.6 KiB515385

reader_test.goH A D09-Mar-20209.4 KiB290233

sio.goH A D09-Mar-202011.5 KiB367222

sio_test.goH A D09-Mar-20202.8 KiB114104

test_vectors.jsonH A D09-Mar-20208.1 KiB3330

writer.goH A D09-Mar-202013.1 KiB530358

writer_test.goH A D09-Mar-20209 KiB303256

README.md

1[![Godoc Reference](https://godoc.org/github.com/secure-io/sio-go?status.svg)](https://godoc.org/github.com/secure-io/sio-go)
2[![Build Status](https://api.cirrus-ci.com/github/secure-io/sio-go.svg?branch=master)](https://cirrus-ci.com/github/secure-io/sio-go)
3
4# Secure IO
5
6The `sio` package implements provable secure authenticated encryption for continuous byte streams.
7It splits a data stream into `L` bytes long fragments and en/decrypts each fragment with an unique
8key-nonce combination using an [AEAD](https://golang.org/pkg/crypto/cipher/#AEAD). For the last
9fragment the construction prefixes the associated data with the `0x80` byte (instead of `0x00`)
10to prevent truncation attacks.
11
12![`sio` encryption scheme](https://github.com/secure-io/sio/blob/master/img/channel_construction.svg)
13
14The `sio` package follows semantic versioning and hasn't reached a stable v1.0.0, yet. So
15newer versions may cause major breaking API changes. However, we try to avoid such changes - if not really
16needed.
17
18### How to use `sio`?
19
20```
21import (
22    "github.com/secure-io/sio-go"
23)
24```
25
26The `sio` package provides APIs for en/decrypting an [`io.Reader`](https://golang.org/pkg/io#Reader)
27or an [`io.Writer`](https://golang.org/pkg/io/#Writer). First, you have to create a
28[`Stream`](https://godoc.org/github.com/secure-io/sio#Stream) instance from a
29[`cipher.AEAD`](https://golang.org/pkg/crypto/cipher/#AEAD) and a buffer size.
30(The buffer size determines the fragment size `L`). You may want to take a look at
31[this example](https://godoc.org/github.com/secure-io/sio-go#example-NewStream--AESGCM).
32
33Then you can use the `Stream` to encrypt resp. decrypt an `io.Reader` or `io.Writer` using
34e.g. the [`EncryptReader`](https://godoc.org/github.com/secure-io/sio-go#Stream.EncryptReader)
35or [`DecryptWriter`](https://godoc.org/github.com/secure-io/sio-go#Stream.DecryptWriter) methods.
36
37For a comprehensive overview of the API please take a look at [godoc.org](https://godoc.org/github.com/secure-io/sio-go).
38