Article View: comp.lang.postscript
Article #443type 1 font encryption
From: Donna Druchunas
Date: Fri, 10 Apr 1992 00:40
Date: Fri, 10 Apr 1992 00:40
49 lines
2095 bytes
2095 bytes
Does anyone out there have the Addison Weseley book on Adobe Type 1
Font Format (the "White Book"?)? I was reading page 62 which gives
the algorithm used for encryption and ran something that I think is
wrong (but sometimes I have to wonder about *my* thought processes
<grin>). Here's the problem:
The algorithm states that you need to:
A. Assign the high order 8 bits of R to a temporary variable, T.
B. Ecslusive-OR P with T, producing a ciphertext byte, C.
C. Compute the next value of R by the formula ((C+R) x c1 +
c2) mod 65536, where c1 is 52845 (decimal) and c2 is 22719
(decimal).
The code ('C') given to perform this algorithm is as follows:
unsigned short int r;
unsigned short int c1;
unsigned short int c2;
unsigned char Encryp(plain) unsigned char plain;
{unsigned char cipher;
cipher = (plain ^ (r>>8);
r = (chipher + r) * c1 + c2;
return cipher;
}
I think the line beginning r= should read:
r = ((cipher + r) * c1 + c2) % 65536;
Or am I missing something? I'd appreciate it if anyone who has
this book would take a look at this page (and the following page
concerning decryption which has an identical "typo" <?>) and let me
know what you think.
Please reply via email (dd@netlink.cts.com) because I've been SWAMPED latel
y
and haven't been able to keep up with the traffic here.
Thanx.
--
INTERNET: dd@netlink.cts.com (Donna Druchunas)
UUCP: ...!nosc!ryptyde!netlink!dd
NetLink Online Communications * Public Access in San Diego, CA (619) 435-6181
Technical Details
Message-ID:
<N3oZiB1w164w@netlink.cts.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!dog.ee.lbl.gov!nosc!ryptyde!ddShow Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!spool.mu.edu!agate!dog.ee.lbl.gov!nosc!ryptyde!dd From: dd@netlink.cts.com (Donna Druchunas) Newsgroups: comp.lang.postscript Subject: type 1 font encryption Message-ID: <N3oZiB1w164w@netlink.cts.com> Date: 10 Apr 92 00:40:46 GMT Article-I.D.: netlink.N3oZiB1w164w Organization: NetLink Online Communications, San Diego CA Lines: 49