-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add
zbar-tools
package to read QRs using webcam and `create-key-sha…
…re-card` script
- Loading branch information
1 parent
21fc410
commit 41a111c
Showing
10 changed files
with
121 additions
and
1 deletion.
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
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 |
---|---|---|
|
@@ -18,3 +18,4 @@ xbitmaps | |
xdg-user-dirs | ||
xinit | ||
xterm | ||
zbar-tools |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
#!/usr/bin/env bash | ||
|
||
function usage() { | ||
cat << EOF | ||
Incorrect parameters used. | ||
Usage: $0 SHARE_NAME SHARE_KEY_VALUE | ||
SHARE_NAME An arbitrary short name for the share | ||
SHARE_KEY_VALUE Value string of the key share (use - to read string from standard input) | ||
This script will generate SHARE_NAME.htm and SHARE_NAME.png files that can be used to print the share as card. | ||
EOF | ||
} | ||
|
||
if [ "$#" -ne 2 ]; then | ||
usage; | ||
exit 1 | ||
fi | ||
|
||
NAME=$1 | ||
INPUT_KEY=$2 | ||
|
||
QR_IMG="./${NAME}.png" | ||
|
||
if [ "${INPUT_KEY}" = "-" ]; then | ||
read | ||
INPUT_KEY="${REPLY}" | ||
fi | ||
|
||
echo "${INPUT_KEY}" | qrencode -o ${QR_IMG} | ||
|
||
cat > ${NAME}.htm << EOHTML | ||
<html> | ||
<head> | ||
<title>Shamir key part card - ${NAME}</title> | ||
<style> | ||
body { background-color: white; font-family: sans-serif} | ||
.card { border: solid black 1mm; padding: 2mm; margin: 1mm; width: 10cm; height: 6cm; } | ||
.header { font-weight: bolder; font-size: 16pt; text-align: center; height: 10mm; } | ||
.content { display: flex; height: 47mm; } | ||
.footer { font-size: 8pt; text-align: center; } | ||
.cell { display: block; } | ||
#key_text { height: 40mm; width: 60mm; } | ||
#key_text h1 { font-size: 12pt; font-weight: bold; margin: 1mm; } | ||
#key_text p { margin: 1mm; } | ||
#key_value { word-break: break-all } | ||
#key_qr { height: 40mm; width: 40mm; text-align: right; } | ||
#key_qr img { height: 100%; width: 100%; } | ||
#instructions { font-size: 8pt; display: block; margin: 0; } | ||
#instructions p { margin: 0; } | ||
</style> | ||
</head> | ||
<body> | ||
<div class="card" id="front"> | ||
<div class="header"> | ||
Shamir key share part | ||
</div> | ||
<div class="content"> | ||
<div class="cell" id="key_text"> | ||
<h1>Name:</h1> | ||
<p id="key_name">${NAME}</p> | ||
<h1>Shamir key share value:</h1> | ||
<p id="key_value">${INPUT_KEY}</p> | ||
</div> | ||
<div class="cell" id="key_qr"> | ||
<img src="${QR_IMG}" /> | ||
</div> | ||
</div> | ||
<div class="footer"> | ||
Generated by Shamir-iso ( https://aitorpazos.es/shamir-iso ) | ||
</div> | ||
</div> | ||
<hr /> | ||
<div class="card" id="back"> | ||
<div class="header"> | ||
Shamir key share instructions | ||
</div> | ||
<div class="content" id="instructions"> | ||
<p> | ||
The key written on the front of this card is one of the shares of a key divided using Shamir's secret sharing | ||
scheme. | ||
</p> | ||
<p> | ||
Important notes: | ||
</p> | ||
<ul> | ||
<li>You can only recover the original key having access to the number of shares defined by the threshold | ||
selected when this part was generated.</li> | ||
<li>Any combination of the shares that count up to the threshold is able to recover the original key.</li> | ||
<li>This is a high value key.</li> | ||
<li>It is important that you keep this key in a safe place and protected from unauthorized access.</li> | ||
</ul> | ||
</div> | ||
<div class="footer"> | ||
Generated by Shamir-iso ( https://aitorpazos.es/shamir-iso ) | ||
</div> | ||
</div> | ||
</body> | ||
</html> | ||
EOHTML |
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 |
---|---|---|
|
@@ -32,3 +32,4 @@ xbitmaps | |
xdg-user-dirs | ||
xinit | ||
xterm | ||
zbar-tools |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.