aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJakob Unterwurzacher2015-09-06 12:12:14 +0200
committerJakob Unterwurzacher2015-09-06 12:12:14 +0200
commitf2e2b813611a57192960e87df90ceed73d8e47d9 (patch)
tree7941a67ce030a63e12b08a825cb4908ebf6a1a91
parent0a35d0970e86efbc5ed494395de7b448d3e337d0 (diff)
Add README.md
Also, run go fmt
-rw-r--r--README.md38
-rw-r--r--main.go21
-rw-r--r--main_test.go13
3 files changed, 54 insertions, 18 deletions
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..a14c0bc
--- /dev/null
+++ b/README.md
@@ -0,0 +1,38 @@
+GoCryptFS
+=========
+A minimal encrypted overlay filesystem written in Go.
+
+Built on top of the
+native Go FUSE library [bazil.org/fuse](https://github.com/bazil/fuse)
+and the [ClueFS](https://github.com/airnandez/cluefs) loopback file system.
+
+Inspired by [EncFS](https://github.com/vgough/encfs).
+
+Design
+------
+* Authenticated encryption of file contents using AES-GCM-128
+ * 96 bit nonce that starts from a random value and counts up
+ * uses openssl through [spacemonkeygo/openssl](https://github.com/spacemonkeygo/openssl)
+ for a 3x speedup compared to `crypto/cipher`
+* AES-CBC filename encryption
+
+Current Status
+--------------
+* Work in progress
+* Key is set to static all-zero
+* Not ready for anything but testing and debugging
+
+Testing
+-------
+Run `./main_benchmark.bash` to run the test suite and the streaming read/write
+benchmark.
+
+The output should look like this:
+
+ $ ./main_benchmark.bash
+ + go build
+ + go test -bench=.
+ PASS
+ BenchmarkStreamWrite 100 14062281 ns/op 74.57 MB/s
+ BenchmarkStreamRead 100 11267741 ns/op 93.06 MB/s
+ ok github.com/rfjakob/gocryptfs 7.569s
diff --git a/main.go b/main.go
index 3619bb7..071415a 100644
--- a/main.go
+++ b/main.go
@@ -1,24 +1,23 @@
package main
import (
- "path/filepath"
+ "bazil.org/fuse"
+ fusefs "bazil.org/fuse/fs"
"flag"
- "os"
"fmt"
"github.com/rfjakob/gocryptfs/frontend"
- "bazil.org/fuse"
- fusefs "bazil.org/fuse/fs"
-
+ "os"
+ "path/filepath"
)
const (
PROGRAM_NAME = "gocryptfs"
- USE_OPENSSL = true
+ USE_OPENSSL = true
- ERREXIT_USAGE = 1
- ERREXIT_NEWFS = 2
- ERREXIT_MOUNT = 3
- ERREXIT_SERVE = 4
+ ERREXIT_USAGE = 1
+ ERREXIT_NEWFS = 2
+ ERREXIT_MOUNT = 3
+ ERREXIT_SERVE = 4
ERREXIT_MOUNT2 = 5
)
@@ -48,7 +47,7 @@ func main() {
fuse.Subtype(PROGRAM_NAME),
fuse.VolumeName(PROGRAM_NAME),
fuse.LocalVolume(),
- fuse.MaxReadahead(1024*1024),
+ fuse.MaxReadahead(1024 * 1024),
}
conn, err := fuse.Mount(mountpoint, mountOpts...)
if err != nil {
diff --git a/main_test.go b/main_test.go
index f17b5f5..6b68b4a 100644
--- a/main_test.go
+++ b/main_test.go
@@ -1,15 +1,15 @@
package main
import (
- "io"
+ "crypto/md5"
+ "encoding/hex"
"fmt"
- "time"
- "testing"
+ "io"
+ "io/ioutil"
"os"
"os/exec"
- "io/ioutil"
- "crypto/md5"
- "encoding/hex"
+ "testing"
+ "time"
)
const tmpDir = "test_tmp_dir/"
@@ -43,7 +43,6 @@ func TestMain(m *testing.M) {
r := m.Run()
-
fu.Run()
os.Exit(r)
}