diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index d8c6fdc..b7729b4 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -13,6 +13,9 @@ jobs: steps: - name: Checkout code uses: actions/checkout@v2 + - name: Get the version + id: get_version + run: echo ::set-output name=VERSION::${GITHUB_REF/refs\/tags\//} - name: Build iso file id: build_iso run: make @@ -37,7 +40,7 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./files-min/debian-custom.iso - asset_name: shamir-manage-min-${{ github.event.release.tag_name }}.iso + asset_name: shamir-manage-min-${{ steps.get_version.outputs.VERSION }}.iso asset_content_type: application/octet-stream - name: Upload xfce Release Asset id: upload-release-asset-xfce @@ -47,5 +50,5 @@ jobs: with: upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps asset_path: ./files-xfce/debian-custom.iso - asset_name: shamir-manage-xfce-${{ github.event.release.tag_name }}.iso + asset_name: shamir-manage-xfce-${{ steps.get_version.outputs.VERSION }}.iso asset_content_type: application/octet-stream diff --git a/.gitignore b/.gitignore index bf1f088..1c71f2e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,9 @@ +# Backup files +**/*~ + +# HAL binary +hal + # IDEs .idea **/*.iml diff --git a/CHANGELOG.md b/CHANGELOG.md index a9f6906..fd55b71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,16 @@ 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.5.0] - 2021-02-28 + +### Added + +- `hal` command from [https://github.com/stevenroose/hal](https://github.com/stevenroose/hal) to manage BIP39 crypto wallets word lists + +### Fixed + +- Version set in GitHub release workflow + ## [0.4.0] - 2021-02-27 ### Added diff --git a/Makefile b/Makefile index dd98699..507af21 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,32 @@ CREATE_DEBIAN_ISO_VERSION:=0.2.0 +HAL_VERSION:=0.6.1 +HAL_RPM_FILE:=hal-bitcoin-$(HAL_VERSION)-1.el7.x86_64.rpm +EXTRACT_DIR:=/tmp/shamir-iso-hal .PHONY: all all: minimal xfce +.PHONY: clean +clean: + rm -rf hal + sudo rm -rf files-min/debian-custom.iso files-xfce/debian-custom.iso + +hal: + mkdir -p $(EXTRACT_DIR) + curl -L -o $(EXTRACT_DIR)/hal.rpm https://github.com/stevenroose/hal/releases/download/v$(HAL_VERSION)/$(HAL_RPM_FILE) + (cd $(EXTRACT_DIR); rpm2cpio ./hal.rpm | cpio -idmv) + cp $(EXTRACT_DIR)/usr/bin/hal ./hal + .PHONY: minimal minimal: files-min/custom-debian.iso .PHONY: xfce xfce: files-xfce/custom-debian.iso -files-min/custom-debian.iso: +files-min/custom-debian.iso: hal + cp hal 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: +files-xfce/custom-debian.iso: hal + cp hal 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 77ed490..e61220e 100644 --- a/README.md +++ b/README.md @@ -75,6 +75,21 @@ Share [3/3]: 5-1224ff0f3253ac71999744 Resulting secret: hello world ``` +### BIP39 Keys + +If you want to use this image to backup or restore your crypto wallet words list, the image includes the `hal` command (from [https://github.com/stevenroose/hal](https://github.com/stevenroose/hal)) which provides different crypto related operations. + +For example: +- Generate entropy value from words list and pass it to `ssss-split`: +```shell +hal bip39 get-seed "your BIP words" | jq -r .entropy | ssss-split -t -n +``` +- Generate words list from entropy value: +```shell +hal bip39 generate -w --entropy +``` +If you don't select the correct number of words, the generation will fail. However the possible values are: 3, 6, 9, 12, 15, 18, 21 or 24 (the usual ones being 12 and 24). + ## Download the image The latest image is published to the [GitHub releases page](https://github.com/aitorpazos/shamir-iso/releases). @@ -85,3 +100,7 @@ You can build the image yourself with `make`. `make minimal` will build the minimal image `make xfce` will build xfce based image + +## TODO + +- Create image for arm64 boards diff --git a/files-min/config/README.txt b/files-min/config/README.txt index 641998c..95ef24d 100644 --- a/files-min/config/README.txt +++ b/files-min/config/README.txt @@ -14,3 +14,14 @@ split -n echo "My text" | qrencode -o - Display QR image: display + +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 + +In order to recover the original words, you can run: +ssss-combine -t +and then generate the words from the returned value: +hal bip39 generate -w --entropy + +If you don't select the correct number of words, the generation will fail. However the possible values are: +3, 6, 9, 12, 15, 18, 21 or 24 (the usual ones being 12 and 24). diff --git a/files-min/config/configure.sh b/files-min/config/configure.sh index 8cc790d..9e08c98 100644 --- a/files-min/config/configure.sh +++ b/files-min/config/configure.sh @@ -5,6 +5,8 @@ export DEBIAN_FRONTEND=noninteractive apt-get purge -y iproute2 iputils-ping cp /root/shamir-background.png /usr/share/pixmaps/shamir-background.png +cp /root/hal /usr/bin/ +chmod a+rx /usr/bin/hal cat > /etc/systemd/system/user-autologin.service << EOF [Unit] diff --git a/files-min/config/packages b/files-min/config/packages index 3e74128..2d69fb2 100644 --- a/files-min/config/packages +++ b/files-min/config/packages @@ -1,5 +1,6 @@ icewm imagemagick +jq less links nano diff --git a/files-min/config/shamir-background.png b/files-min/config/shamir-background.png index d403748..7137b39 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 fea6033..f42e2fc 100644 --- a/files-xfce/config/README.txt +++ b/files-xfce/config/README.txt @@ -15,6 +15,17 @@ echo "My text" | qrencode -o - Display QR image: display +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 + +In order to recover the original words, you can run: +ssss-combine -t +and then generate the words from the returned value: +hal bip39 generate -w --entropy + +If you don't select the correct number of words, the generation will fail. However the possible values are: +3, 6, 9, 12, 15, 18, 21 or 24 (the usual ones being 12 and 24). + ## Experimental USB printer support: - Add a printer (user: user , password: user) using CUPS admin page in the browser: diff --git a/files-xfce/config/configure.sh b/files-xfce/config/configure.sh index e75a121..4ab4fa1 100644 --- a/files-xfce/config/configure.sh +++ b/files-xfce/config/configure.sh @@ -7,6 +7,9 @@ apt-get purge -y iproute2 iputils-ping cp /root/shamir-background.png /usr/share/pixmaps/shamir-background.png chmod a+r /usr/share/pixmaps/shamir-background.png +cp /root/hal /usr/bin/ +chmod a+rx /usr/bin/hal + cat > /etc/skel/.config/epiphany/web-extension-settings.ini << EOF [org/gnome/epiphany] homepage-url='http://127.0.0.1:631/admin' diff --git a/files-xfce/config/packages b/files-xfce/config/packages index 68b708d..cc748b1 100644 --- a/files-xfce/config/packages +++ b/files-xfce/config/packages @@ -10,6 +10,7 @@ hp-ppd hpijs-ppds hplip imagemagick +jq less links nano diff --git a/files-xfce/config/shamir-background.png b/files-xfce/config/shamir-background.png index 700b9e6..108dc01 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 1786f97..019f96c 100644 Binary files a/shamir-background.kra and b/shamir-background.kra differ