Yeah, yeah, yeah. Only problem is the constraint that GPG must be specified as the allowed source encryption standard a priori. This was NOT in the original problem description. There is NO algorithm which will determine if an arbitrary piece of text is encrypted by an arbitrary algorithm. You can tell, at least statistically if a particular piece of arbitrary text ISN'T a particular algorithm or language either. Again, not the same problem. ____________________________________________________________________ Before a larger group can see the virtue of an idea, a smaller group must first understand it. "Stranger Suns" George Zebrowski The Armadillo Group ,::////;::-. James Choate Austin, Tx /:'///// ``::>/|/ ravage@ssz.com www.ssz.com .', |||| `/( e\ 512-451-7087 -====~~mm-'`-```-mm --'- -------------------------------------------------------------------- ---------- Forwarded message ---------- Date: 21 Feb 2001 19:44:33 -0000 From: Septic Remailer Admin <septic-admin@nym.alias.net> To: Jim Choate <ravage@EINSTEIN.ssz.com> Subject: Testing for encryption. -----BEGIN PGP SIGNED MESSAGE----- #!/usr/bin/perl # name: encryption_check.pl # purpose: Tests if STDIN is encrypted. Prints file to STDOUT if # it is encrypted. Discards unencrypted files. # requires: /bin/tempfile from debianutils, /usr/bin/gpg # TODO: # Does it need to detect Mixmaster messages? # It should handle pings (i.e. plain text) to another remailer # by checking rlist or some arbitrary whitelist. # author: septic-admin@nym.alias.net # date: 4 OCT 2000 # license: GPL if (!-x "/bin/tempfile") { die "requires /bin/tempfile"; } if (!-x "/usr/bin/gpg") { die "requires /usr/bin/gpg"; } my $TMP = `tempfile` || die "cannot create temp file"; my $ENCRYPTED = 0; # Store the file. open(TEMPFILE, ">$TMP") || die "cannot open temp file"; while (<>) { print TEMPFILE; } close(TEMPFILE) || die "cannot close tempfile"; # Test the file. open(GPG, "gpg --batch 2>&1 <$TMP|") || die "cannot open GPG pipe"; while (<GPG>) { if ($_ =~ /^gpg: encrypted/) { $ENCRYPTED = 1; } } close(GPG); # Insert code here to test destination against whitelist (for pings). # Print the file to STDOUT if it is encrypted. if ($ENCRYPTED) { open(TEMPFILE, "<$TMP") || die "cannot reopen temp file"; while (<TEMPFILE>) { print; } close(TEMPFILE); } unlink $TMP || die "cannot unlink temp file"; -----BEGIN PGP SIGNATURE----- Version: 2.6.3a Charset: noconv iQCVAwUBOpQLgHT63FdzI1K1AQELwAQAr44gXDXjrHGzhF+Dj7YTw37hBkDrQaBf QhmCRf22ikzWEazvWIqCCMOMRd5nB+bD454JWI5G7QWAOHNvU8lL2S4kxRIFqNyr gA1vdrs5MlzRYQptjz2HpFpfx7BEO1mxsSXrlsCqOrNkAYmnhicfVgoMXcdYyQul Rvw13C4kasw= =UEL2 -----END PGP SIGNATURE-----