Skip to content

Instantly share code, notes, and snippets.

@endreszabo
Created January 20, 2014 22:46
Show Gist options
  • Save endreszabo/8530941 to your computer and use it in GitHub Desktop.
Save endreszabo/8530941 to your computer and use it in GitHub Desktop.
aessss. q&d combination of aes and ssss.
#!/bin/bash
for i in $*; do
HASH=$(openssl dgst -sha256 -binary < "$i" | perl -ne'map{printf("%02x",ord($_))} split//')
KEY=$(dd if=/dev/random bs=1 count=32 | perl -ne'map{printf("%02x",ord($_))} split//')
echo -n "$KEY" | openssl aes256 -aes-256-xts -e -pass stdin -in "$i" -out "${HASH}.bin"
echo -n "$KEY" | ssss-split -x -t 3 -n 4 -w "$HASH" -q | split --lines=1 --numeric-suffixes=1 --suffix-length=1 - "$HASH-"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment