[comp.archives] [crypt] TACT for cryptanalysis

mirage1@gpu.utcs.utoronto.ca (Robert Ames) (06/12/91)

Archive-name: text/analysis/tact/0--
Archive-directory: epas.utoronto.ca:/pub/cch/archive/tact/ [128.100.160.1]
Original-posting-by: mirage1@gpu.utcs.utoronto.ca (Robert Ames)
Original-subject: TACT for cryptanalysis
Reposted-by: emv@msen.com (Edward Vielmetti, MSEN)

A new MS-DOS text analysis program has been released by the University of
Toronto which has some functions that could be of value to cryptanalysts.
Aside from word frequencies, KWIC, and the usual stuff, "TACT" analyzes
"collocates", which are words found within a certain number of words
from the target word.  TACT has provisions for text markup, user-defined
rule sets, scripts, and so on.  It supports several languages by using
extended ASCII.

I wrote a little utility, appended below, to split ciphertext up into
pseudo-words, so that TACT can handle the data.

The program is free to anyone who can ftp to epas.utoronto.ca.  It's in the
/pub/cch/archive/tact/dist directory.  For a (useful) printed manual and a
diskette send $30 to this address:

TACT Distribution
Centre for Computing in the Humanities,
Robarts Library, Room 14297A,
University of Toronto,
Toronto, Ontario
Canada, M5S 1A5

------------------cut---------------------------------------
/* wordify.c : break ciphertext into triples for analysis */
#include <stdio.h>
#include <stdlib.h>
/* for Unix use <sys/types.h> */
void usage();

main(argc, argv)
    int argc;
    char **argv;
{
    int ch, i, j, round;
    FILE *in;

    in = fopen(argv[1], "r");
    if (!in)
	usage(argv[0]);

    for (round = 0; round < 3; round++)
    {
	rewind(in);
	for (i = 0; i <= round; i++)
	{
	    ch = getc(in);
	    putchar(ch);
	}
	putchar(' ');
	while (ch != -1)
	{
	    for (j = 0; j < 18; j++)
	    {
		for (i = 0; i < 3; i++)
		{
		    ch = getc(in);
		    if (ch != ('\n'))
			if (ch != (' '))
			    putchar(ch);
			else
			    i--;
		}
		putchar(' ');
	    }
	    putchar('\n');
	}
    }
    fclose(in);
}

void
usage(file)
{
    printf("\nUsage: %s CIPHERFILE > WORDFILE", file);
    printf("\n\n\Purpose: to convert ciphertext to pseudo words for\n");
    printf("analysis with the Tact programs\n");
    exit(1);
}   /* R. Ames 8 Jun 91 */

-- 

Robert Ames			P.O. Box 724, Station 'A'
416-593-6000			Toronto, Ontario, Canada


-- comp.archives file verification
epas.utoronto.ca
total 21
drwxr-xr-x   2 bradley  cchftp       512 Jun  8 11:18 dist
drwxr-xr-x   2 1155     user         512 May 20 18:15 tactutil
drwxrwxr-x   2 bradley  cchftp       512 May 10 10:05 tactdemo
drwxr-xr-x   2 bradley  cchftp       512 Apr 26 14:43 dist1.2
-rw-rw-r--   1 mccarty  user        1497 Apr 26 12:21 tact-l.notice
-rw-rw-r--   1 mccarty  cchftp      6758 Apr 26 12:11 whatis.tact
found tact ok
epas.utoronto.ca:/pub/cch/archive/tact/