| 1 |
#!/bin/sh |
| 2 |
# this script tries to emulate the unix crypt command using mcrypt |
| 3 |
|
| 4 |
echo "Unix crypt(1) emulation program using mcrypt(1)." >&2 |
| 5 |
echo "" >&2 |
| 6 |
|
| 7 |
if [ "$1" = "-h" ] || [ "$1" = "--help" ] |
| 8 |
then |
| 9 |
echo 'Usage: crypt password <file_in >file_out' >&2 |
| 10 |
echo 'Usage: crypt <file_in >file_out' >&2 |
| 11 |
exit 1 |
| 12 |
else |
| 13 |
echo "Use crypt -h for more help." >&2 |
| 14 |
fi |
| 15 |
|
| 16 |
if [ -z "$1" ] |
| 17 |
then |
| 18 |
mcrypt -a enigma -o scrypt -m stream --bare --force |
| 19 |
else |
| 20 |
mcrypt -a enigma -o scrypt -m stream --bare --key $1 --force |
| 21 |
fi |
| 22 |
|