diff --git a/.gitignore b/.gitignore index adc35f5..fae7b6c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,8 @@ hal # scrypt-rs binary scrypt-rs +# ssss-rs binary +ssss-rs # IDEs .idea diff --git a/CHANGELOG.md b/CHANGELOG.md index 3d4fd62..da40246 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +## [0.9.0] - 2021-04-22 + +### Changed + +- [ssss-combine and ssss-split](http://point-at-infinity.org/ssss/) replaced by [ssss-rs](https://github.com/aitorpazos/ssss-rs) + command + ## [0.8.1] - 2021-03-28 ### Added diff --git a/Makefile b/Makefile index 7cf1654..d81b009 100644 --- a/Makefile +++ b/Makefile @@ -1,8 +1,10 @@ CREATE_DEBIAN_ISO_VERSION:=0.2.0 HAL_VERSION:=0.6.1 HAL_RPM_FILE:=hal-bitcoin-$(HAL_VERSION)-1.el7.x86_64.rpm -SCRYPT_RS_VERSION:=0.2.0 +SCRYPT_RS_VERSION:=0.3.0 SCRYPT_RS_TARBALL_FILE:=scrypt-rs-amd64-v$(SCRYPT_RS_VERSION).tar.gz +SSSS_RS_VERSION:=0.1.0 +SSSS_RS_TARBALL_FILE:=ssss-rs-amd64-v$(SSSS_RS_VERSION).tar.gz EXTRACT_DIR:=/tmp/shamir-iso-files .PHONY: all @@ -10,8 +12,8 @@ all: minimal xfce .PHONY: clean clean: - rm -rf hal scrypt-rs - rm -rf files-{min,xfce}/config/{hal,scrypt-rs} + rm -rf hal scrypt-rs ssss-rs + rm -rf files-{min,xfce}/config/{hal,scrypt-rs,ssss-rs} sudo rm -rf files-{min,xfce}/debian-custom.iso hal: @@ -26,16 +28,22 @@ scrypt-rs: (cd $(EXTRACT_DIR); tar -xvf scrypt-rs.tar.gz) cp $(EXTRACT_DIR)/scrypt-rs ./scrypt-rs +ssss-rs: + mkdir -p $(EXTRACT_DIR) + curl -L -o $(EXTRACT_DIR)/ssss-rs.tar.gz https://github.com/aitorpazos/ssss-rs/releases/download/v$(SSSS_RS_VERSION)/$(SSSS_RS_TARBALL_FILE) + (cd $(EXTRACT_DIR); tar -xvf ssss-rs.tar.gz) + cp $(EXTRACT_DIR)/ssss-rs ./ssss-rs + .PHONY: minimal minimal: files-min/custom-debian.iso .PHONY: xfce xfce: files-xfce/custom-debian.iso -files-min/custom-debian.iso: hal scrypt-rs - cp hal scrypt-rs files-min/config/ +files-min/custom-debian.iso: hal scrypt-rs ssss-rs + cp hal scrypt-rs ssss-rs files-min/config/ docker run --rm -t -v $(shell pwd)/files-min:/root/files aitorpazos/create-debian-iso:$(CREATE_DEBIAN_ISO_VERSION) -files-xfce/custom-debian.iso: hal scrypt-rs - cp hal scrypt-rs files-xfce/config/ +files-xfce/custom-debian.iso: hal scrypt-rs ssss-rs + cp hal scrypt-rs ssss-rs files-xfce/config/ docker run --rm -t -v $(shell pwd)/files-xfce:/root/files aitorpazos/create-debian-iso:$(CREATE_DEBIAN_ISO_VERSION) diff --git a/README.md b/README.md index e61220e..21cced8 100644 --- a/README.md +++ b/README.md @@ -38,23 +38,21 @@ in your firmware options** ### Split a key -To split a given key use the `ssss-split` command setting how many shares you want to create and how many of them are needed +To split a given key use the `ssss-rs split` command setting how many shares you want to create and how many of them are needed to recover the original key. Example where the key is divided in 5 pieces and can be recovered with any of 3 pieces): ```shell -echo "hello world" | ssss-split -t 3 -n 5 +echo "hello world" | ssss-rs split -t3 -s5 -i - ``` Output: ``` -Generating shares using a (3,5) scheme with dynamic security level. -Enter the secret, at most 128 ASCII characters: Using a 48 bit security level. -1-79f847d32bc7d404219fe0 -2-358a7ebd071055db71670f -3-ce9914f9142d07c513d320 -4-e937954b216efe6ffb2379 -5-1224ff0f3253ac71999744 +017ec708e757c335e716f36b +0274d0d41038183484dfffd0 +036272b09b00fb760cbb60df +049091dc4b5de9c00fbcbf89 +058633b8c0650a8287d82086 ``` ### Recover a key @@ -62,17 +60,16 @@ Enter the secret, at most 128 ASCII characters: Using a 48 bit security level. To recover a key from the splitted keys, you can run the following command (using above split): ```shell -ssss-combine -t 3 +ssss-rs combine 0274d0d41038183484dfffd0 049091dc4b5de9c00fbcbf89 058633b8c0650a8287d82086 ``` Output: ``` -Enter 3 shares separated by newlines: -Share [1/3]: 2-358a7ebd071055db71670f -Share [2/3]: 4-e937954b216efe6ffb2379 -Share [3/3]: 5-1224ff0f3253ac71999744 -Resulting secret: hello world +Recovered key: hello world +Recovered key in base64: aGVsbG8gd29ybGQ= +Error decoding key to hex (expected for non hexadecimal keys): OddLength +BIP39 words list generation skipped ``` ### BIP39 Keys diff --git a/files-min/config/README.txt b/files-min/config/README.txt index c166d9c..4fc6538 100644 --- a/files-min/config/README.txt +++ b/files-min/config/README.txt @@ -4,12 +4,9 @@ These commands are only provided to try to help you in the use of this image. They may or may not suit your needs. - Split a key in n number of pieces that you can recover with any x number of them (max 128 characters): -echo "My key" | ssss-split -t -n +echo "My key" | ssss-rs split -t -s -i - - Recover the key from t number of pieces: -ssss-combine -t -- If the key is longer than 128 characters, you can split it into n number of pieces using the following - command: -split -n +ssss-rs combine - Generate scrypt derived keys echo "My passphrase" | scrypt-rs -l -s - Generate a QR image: @@ -20,10 +17,10 @@ display zbarcam --raw If you are dealing with BIP39 word lists or seeds you can use the `hal` command: -hal bip39 get-seed "your BIP words" | jq -r .entropy | ssss-split -t -n +hal bip39 get-seed "your BIP words" | jq -r .entropy | ssss-rs split -t -s -i - In order to recover the original words, you can run: -ssss-combine -t +ssss-rs combine and then generate the words from the returned value: hal bip39 generate -w --entropy diff --git a/files-min/config/configure.sh b/files-min/config/configure.sh index 6712a50..772a572 100644 --- a/files-min/config/configure.sh +++ b/files-min/config/configure.sh @@ -7,7 +7,8 @@ apt-get purge -y iproute2 iputils-ping cp /root/shamir-background.png /usr/share/pixmaps/shamir-background.png cp /root/hal /usr/bin/ cp /root/scrypt-rs /usr/bin/ -chmod a+rx /usr/bin/hal /usr/bin/scrypt-rs +cp /root/ssss-rs /usr/bin/ +chmod a+rx /usr/bin/hal /usr/bin/scrypt-rs /usr/bin/ssss-rs cat > /etc/systemd/system/user-autologin.service << EOF [Unit] diff --git a/files-min/config/shamir-background.png b/files-min/config/shamir-background.png index ce232ea..309de64 100644 Binary files a/files-min/config/shamir-background.png and b/files-min/config/shamir-background.png differ diff --git a/files-xfce/config/README.txt b/files-xfce/config/README.txt index 88a5a80..25176b7 100644 --- a/files-xfce/config/README.txt +++ b/files-xfce/config/README.txt @@ -3,13 +3,10 @@ These commands are only provided to try to help you in the use of this image. They may or may not suit your needs. -- Split a key in n number of pieces that you can recover with any x number of them (max 128 characters): -echo "My key" | ssss-split -t -n +- Split a key in n number of pieces that you can recover with any x number of them: +echo "My key" | ssss-rs split -t -s -i - - Recover the key from t number of pieces: -ssss-combine -t -- If the key is longer than 128 characters, you can split it into n number of pieces using the following - command: -split -n +ssss-rs combine - Generate scrypt derived keys echo "My passphrase" | scrypt-rs -l -s - Generate a QR image: @@ -20,10 +17,10 @@ display zbarcam --raw If you are dealing with BIP39 word lists or seeds you can use the `hal` command: -hal bip39 get-seed "your BIP words" | jq -r .entropy | ssss-split -t -n +hal bip39 get-seed "your BIP words" | jq -r .entropy | ssss-rs split -t -s -i - In order to recover the original words, you can run: -ssss-combine -t +ssss-rs combine and then generate the words from the returned value: hal bip39 generate -w --entropy diff --git a/files-xfce/config/configure.sh b/files-xfce/config/configure.sh index a081d3c..aebc80a 100644 --- a/files-xfce/config/configure.sh +++ b/files-xfce/config/configure.sh @@ -9,8 +9,9 @@ chmod a+r /usr/share/pixmaps/shamir-background.png cp /root/hal /usr/bin/ cp /root/scrypt-rs /usr/bin/ +cp /root/ssss-rs /usr/bin/ cp /root/create-key-share-card /usr/bin/ -chmod a+rx /usr/bin/hal /usr/bin/scrypt-rs /usr/bin/create-key-share-card +chmod a+rx /usr/bin/hal /usr/bin/scrypt-rs /usr/bin/ssss-rs /usr/bin/create-key-share-card cat > /etc/skel/.config/epiphany/web-extension-settings.ini << EOF [org/gnome/epiphany] diff --git a/files-xfce/config/shamir-background.png b/files-xfce/config/shamir-background.png index 7c13ff3..fd3afc7 100644 Binary files a/files-xfce/config/shamir-background.png and b/files-xfce/config/shamir-background.png differ diff --git a/shamir-background.kra b/shamir-background.kra index d61855c..ac45f73 100644 Binary files a/shamir-background.kra and b/shamir-background.kra differ