-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfontcrypt.c
executable file
·59 lines (51 loc) · 1.61 KB
/
fontcrypt.c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/* PostScript font encryption machinery
Copyright 1983 -- Adobe Systems, Inc.
PostScript is a trademark of Adobe Systems, Inc.
NOTICE: All information contained herein or attendant hereto is, and
remains, the property of Adobe Systems, Inc. Many of the intellectual
and technical concepts contained herein are proprietary to Adobe Systems,
Inc. and may be covered by U.S. and Foreign Patents or Patents Pending or
are protected as trade secrets. Any dissemination of this information or
reproduction of this material are strictly forbidden unless prior written
permission is obtained from Adobe Systems, Inc.
Original version: Chuck Geschke: November 1, 1983
Edit History:
Chuck Geschke: Thu Dec 22 14:00:01 1983
End Edit History.
*/
#include "postscript.h"
private integer rndnum;
private StreamHandle instream, outstream;
private StreamHandle OpenFileStream(str, acc)
string str, acc;
{
StreamHandle s;
s = fopen(str, acc);
if (s == NULL) {printf("Cannot open %s\n"); exit(0);}
return s;
}
private CloseFileStream(s)
StreamHandle;
{
fclose(s);
}
main(argc, argv)
int argc; char *argv[];
{
integer i; char c;
if ((argc & 1) != 1){
printf("Odd number (%d) of file params!\n", argc-1); exit(0);}
for (i = 1; i < argc; i += 2){
instream = OpenFileStream(argv[i],"r");
outstream = OpenFileStream(argv[i+1],"w");
printf("%s ... ",argv[i]);
InitRnum(RnumSeed);
while(true){
c = getc(instream);
if ((c == EOF) && feof(instream)) break;
c ^= Rnum8();
putc(c, outstream);}
CloseFileStream(outstream);
printf("%s\n",argv[i+i]);
CloseFileStream(instream);}
}