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