google / google/fscrypt

Move to a better memory locking library

Open
#81 0 comments 1 reaction 1 assignee Claimed by @josephlr View on GitHub
enhancement
Dominant language
Go
Stars
1k
Forks
111
Avg merge
2d 19h
Merged PRs (30d)
3

Description

Fscrypt uses the [`Key struct`](https://github.com/google/fscrypt/blob/master/crypto/key.go) to keep sensitive cryptographic data locked in memory and zeroed after use. However, this would be better spun out into a separate library (as it doesn't really deal much with fscrypt).

Luckily, @awnumar has written [memguard](https://github.com/awnumar/memguard) a library for handling secrets in go. It does everything we want and more, but at the cost of requiring some changes to fscrypt ([`memguard.CatchInterrupt`](https://godoc.org/github.com/awnumar/memguard#CatchInterrupt) and [`memguard.SafeExit`](https://godoc.org/github.com/awnumar/memguard#SafeExit)).

I'll need to do a more through read though of the code, but it looks good so far. In fact, the [development of memguard incorporated things we learned with fscrypt](https://github.com/awnumar/memguard/issues/3#issuecomment-296415189). It really looks like this would be a strict improvement.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.