-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build static binaries w/ libsodium for release (#5)
* Build static binaries w/ libsodium for release * Add readme content * Stretch password word count to 6 * Read unseal password from stdin if not provided during launch * Fix attrs block reading and always canonicalize the input path before continuing * Fix tests
- Loading branch information
Showing
13 changed files
with
123 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,50 @@ | ||
# sneakercopy | ||
|
||
## Requirements | ||
A tool for creating encrypted archives for handling sensitive content. | ||
|
||
- [libsodium](https://github.com/jedisct1/libsodium) | ||
- macOS: `brew install libsodium` | ||
- Linux: Tested down to libsodium v1.0.11 (`libsodium18` on Debian 9.5) | ||
Sneakercopy stands on the shoulders of giants such as [tar], | ||
[sodiumoxide] / [libsodium], and [libflate] to pack, compress, | ||
and encrypt sensitive files into a light container called a "tarbox". | ||
|
||
We use the system defined in [RFC2289] to generate short, memorable, | ||
easily writable passwords. `libsodium`'s `scryptsalsa208sha256` is used to derive | ||
a hash to encrypt the compressed data stream with. | ||
|
||
[tar]: https://crates.io/crates/tar | ||
[sodiumoxide]: https://crates.io/crates/sodiumoxide | ||
[libsodium]: https://github.com/jedisct1/libsodium | ||
[libflate]: https://crates.io/crates/libflate | ||
[RFC2289]: https://tools.ietf.org/html/rfc2289 | ||
|
||
## Usage | ||
|
||
### Seal a file/directory | ||
|
||
``` | ||
# Creates `directory.tarbox` in the current directory | ||
λ sneakercopy seal /path/to/directory | ||
⢀⠀ Packing... | ||
secret: FOWL-BON-MEMO-ROSY-HORN | ||
# Creates `configs.tarbox` in `/var/backups` | ||
λ sneakercopy seal -o /var/backups/configs.tarbox /etc | ||
⢀⠀ Packing... | ||
secret: ROAD-SHIN-TAKE-OLDY-YANK | ||
``` | ||
|
||
### Unseal a tarbox | ||
|
||
``` | ||
# Unseals the contents of `directory.tarbox` into current directory | ||
λ sneakercopy unseal ./directory.tarbox FOWL-BON-MEMO-ROSY-HORN | ||
# Unseals the contents of `configs.tarbox` into `/etc` | ||
λ sneakercopy unseal -C /etc/ /var/backups/configs.tarbox ROAD-SHIN-TAKE-OLDY-YANK | ||
``` | ||
|
||
## Compiling | ||
|
||
- Install `libsodium` | ||
- Use `./ci/libsodium-build.sh` to prepare a static `libsodium` installation | ||
- Set up build flags with `./ci/libsodium-env.sh` | ||
- `cargo build` | ||
- Done! |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/usr/bin/env bash | ||
|
||
LIBSODIUM_VERSION=${LIBSODIUM_VERSION:-1.0.16} | ||
|
||
mkdir -p $HOME/lib/libsodium | ||
curl -sSL -olibsodium.tar.gz https://github.com/jedisct1/libsodium/releases/download/${LIBSODIUM_VERSION}/libsodium-${LIBSODIUM_VERSION}.tar.gz | ||
tar xvfz libsodium.tar.gz --strip-components 1 -C $HOME/lib/libsodium | ||
pushd $HOME/lib/libsodium && \ | ||
./configure \ | ||
--prefix=$HOME/lib/libsodium \ | ||
--disable-debug \ | ||
--disable-dependency-tracking \ | ||
--disable-shared && \ | ||
make && \ | ||
make install && \ | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#!/usr/bin/env bash | ||
|
||
export PKG_CONFIG_PATH=$HOME/lib/libsodium/lib/pkgconfig:$PKG_CONFIG_PATH | ||
export LD_LIBRARY_PATH=$HOME/lib/libsodium/lib:$LD_LIBRARY_PATH | ||
|
||
export SODIUM_STATIC=true | ||
export SODIUM_LIB_DIR=$HOME/lib/libsodium/src/libsodium/.libs | ||
export SODIUM_INC_DIR=$HOME/lib/libsodium/src/libsodium/include |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters