#!/bin/bash
PASS=$1
LEN=$2
if [ -f key.bin ]
then
true
else
exit 1
fi
if [ "$LEN" != "" ] && [ "$LEN" -le "48" ]
then
true
else
exit 2
fi
KEY="$(cat key.bin|pv|xxd -ps -c 1)"
echo "$PASS $(echo $KEY|tr -d ' '|xxd -r -p|tr -dc 'A-Za-z0-9')"|sha256sum|awk '{print $1}'|md5sum \
|awk '{print $1}'|sha256sum|awk '{print $1}'|sha512sum|awk '{print $1}'|rev \
|sed -e 's/a/z/' -e 's/b/y/' -e 's/c/x/' -e 's/e/w/' -e 's/f/v/' \
|tr '[:lower:]' '[:upper:]'|rev|sed -e 's/1/a/' -e 's/2/b/' -e 's/3/c/' -e 's/4/f/'|tr 'A' 'a'|tr 'Z' 'z'|head -c $LEN
printf "l${LEN}ne"
printf '\n'
Запускать так:
./obpass <вашпароль> <размер зашифрованного пароля>
Перемещено jollheef из development