... | @@ -27,6 +27,7 @@ Todo el ether se distribuye asi: |
... | @@ -27,6 +27,7 @@ Todo el ether se distribuye asi: |
|
3100 cuentas en total. Cada cuenta tiene una clave distinta. Vamos a usar 768 bits (binario) claves en base 64 (1024 caracteres):
|
|
3100 cuentas en total. Cada cuenta tiene una clave distinta. Vamos a usar 768 bits (binario) claves en base 64 (1024 caracteres):
|
|
|
|
|
|
```bash
|
|
```bash
|
|
|
|
#!/bin/bash
|
|
dir=bfavault
|
|
dir=bfavault
|
|
|
|
|
|
function genacct
|
|
function genacct
|
... | @@ -44,6 +45,28 @@ function genacct |
... | @@ -44,6 +45,28 @@ function genacct |
|
rmdir new || exit 1
|
|
rmdir new || exit 1
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function dist
|
|
|
|
{
|
|
|
|
threshold=$1
|
|
|
|
for i in $( seq 1 $threshold ); do mkdir accounts/share.$i
|
|
|
|
for file in accounts/*
|
|
|
|
do
|
|
|
|
account=${file#.*--}
|
|
|
|
i=$( wc -l accounts/${account}.shares )
|
|
|
|
while [ $i -gt 0 ]
|
|
|
|
do
|
|
|
|
from=accounts/${account}.shares
|
|
|
|
to=accounts/share.${i}/${account}.passshare
|
|
|
|
grep -- -${i}- $from > $to
|
|
|
|
test $( wc -l $to ) -eq 1
|
|
|
|
# Each share holder gets a copy of the protected key file
|
|
|
|
cp -p ${file} accounts/share.${i}/
|
|
|
|
let i--
|
|
|
|
done
|
|
|
|
rm ${file} $from
|
|
|
|
done
|
|
|
|
}
|
|
|
|
|
|
trap "echo Argh;exit 1" ERR
|
|
trap "echo Argh;exit 1" ERR
|
|
set -o errtrace
|
|
set -o errtrace
|
|
swapoff -a
|
|
swapoff -a
|
... | @@ -55,10 +78,6 @@ do |
... | @@ -55,10 +78,6 @@ do |
|
genacct 2 5
|
|
genacct 2 5
|
|
let i--
|
|
let i--
|
|
done
|
|
done
|
|
```
|
|
dist 5
|
|
|
|
echo A copiar a USB cada una de las carpetas account.share.*
|
|
Falta compartir los shares y accounts
|
|
``` |
|
|
|
\ No newline at end of file |
|
|
|
|
|
|
|
|
|
|
|
|