#!/usr/bin/perl # # Non-linear analysis from Hacking Exposed: Web Security # p. 180-181 # # Small modifications by Paco Hope to use the # Math::BigInt module use Math::BigInt; @seq = (); @x = @y = @z = (); while( <> ) { chomp( $val = $_ ); push( @seq, Math::BigInt->new($val) ); } for( $i=3; $i < $#seq; $i++ ) { push(@x, $seq[i] - $seq[$i-1]); push(@y, $seq[i-1] - $seq[$i-2]); push(@z, $seq[i-2] - $seq[$i-3]); } for( $i=0; $i < $#seq; $i++ ) { printf( "%s %s %s\n", $x[$i], $y[$i], $z[$i]); }