#!/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=22\n'/|bc` echo the seed is $SEED setenv ARRAY ${1} setenv WIDTH `echo 'sqrt ('${1}')' | sed s/^/'scale=22\n'/ | bc | cut -f1 -d'.'` setenv SEEDARRAY `echo ${SEED}'*'${1} | sed s/^/'scale=22\n'/ | bc | cut -f1 -d'.'` setenv SEEDWIDTH `echo ${SEED}'*'${WIDTH} | sed s/^/'scale=22\n'/ | bc | cut -f1 -d'.'` echo the array size is $ARRAY echo the width size is $WIDTH echo the seed array size is $SEEDARRAY echo the seed width size is $SEEDWIDTH #seq 1 ${1} | rs | rs -t ${SEEDARRAY} | tac | rs 1 |\ # rs | rs -t 4 | tac | rs 10 |\ # rs | rs -t 51 | tac | rs 7 |\ # rs | rs -t ${WIDTH} | tac | rs 29 |\ # rs | rs -t 101 | tac | rs 13 |\ # rs | rs -t 213 | tac | rs 17 |\ # rs | rs -t ${SEEDWIDTH} | tac | rs 29 |\ # rs seq 1 ${1} | rs | rs -t ${SEEDARRAY} | tac |\ rs | rs -t 213 | tac |\ rs | rs -t 101 | tac |\ rs | rs -t ${WIDTH} | tac |\ rs | rs -t 51 | tac |\ rs | rs -t 4 | tac |\ rs | rs -t ${SEEDWIDTH} | tac |\ rs