/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/* Copyright (c) 1984, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* A one-rotor machine designed along the lines of Enigma
* but considerably trivialized.
*/
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <crypt.h>
#include <errno.h>
static void
char *pw;
{
unsigned random;
long seed;
char *ret;
int err;
errno = 0;
exit(1);
}
seed = 123;
for (i = 0; i < 13; i++)
for (i = 0; i < ROTORSZ; i++) {
t1[i] = i;
t3[i] = 0;
}
for (i = 0; i < ROTORSZ; i++) {
k = ROTORSZ-1 - i;
random >>= 8;
if (t3[k] != 0) continue;
}
for (i = 0; i < ROTORSZ; i++)
}
int
{
extern int optind;
char *p1;
int c;
struct {
long offset;
unsigned int count;
} header;
int pflag = 0;
int kflag = 0;
char *buf;
char *s;
if (argc < 2) {
exit(1);
}
} else {
switch (c) {
case 'p':
/* notify editor that exec has succeeded */
exit(1);
exit(1);
pflag = 1;
break;
case 'k':
"CrYpTkEy not set.\n");
exit(1);
}
kflag = 1;
break;
case '?':
"usage: crypt [ -k ] [ key]\n");
exit(2);
}
}
}
if (pflag)
for (;;) {
!= sizeof (header))
exit(1);
while (nchar--) {
n1++;
n1 = 0;
n2++;
}
p1++;
}
exit(1);
}
n1 = 0;
n2 = 0;
while ((i = getchar()) >= 0) {
(void) putchar(i);
n1++;
n1 = 0;
n2++;
}
}
return (0);
}