#!/bin/csh # # scrypto # some shell based crypto by Michael L. Love (GPL) # Wed Sep 5 14:42:02 EDT 2007 # date --version > /dev/null if ( $? != 0 ) then echo this only works with GNU date exit endif #setenv SEED `date +%N | cut -b1-6 | sed s/'$'/'\/999999'/ | sed s/^/'scale=214748364\n'/ | bc` setenv SEED `date +%N | cut -b1-6 | sed s/'$'/'\/999999'/ | sed s/^/'scale=22\n'/|bc` echo the seed is $SEED setenv ARRAY `echo ${1}'-1' | sed s/^/'scale=22\n'/ | bc` echo the array size is $ARRAY #setenv SEEDARRAY `echo '${SEED}*${1}' | sed s/^/'scale=214748364\n'/ | bc` setenv SEEDARRAY `echo ${SEED}'*'${1} | sed s/^/'scale=22\n'/ | bc | cut -f1 -d'.'` echo the seed array size is $SEEDARRAY #setenv WIDTH `echo ${1}'*4' | sed s/^/'scale=22\n'/ | bc` setenv WIDTH `echo 'sqrt ('${1}')' | sed s/^/'scale=22\n'/ | bc | cut -f1 -d'.'` echo the width is $WIDTH #seq 1 ${1} | rs | rs -t ${ARRAY} | tac | rs 1 | rs | rs -t ${SEEDARRAY} | tac | rs 1 | rs | rs 10 seq 1 ${1} | rs -w${WIDTH} | rs -w${WIDTH} -t ${ARRAY} | tac | rs -w${WIDTH} 1 | rs -w${WIDTH} | rs -w${WIDTH} -t ${SEEDARRAY} | tac | rs -w${WIDTH} 1 | rs -w${WIDTH} | rs -w${WIDTH} 10