1 //========================================================================
5 // Copyright 1996-2002 Glyph & Cog, LLC
7 //========================================================================
19 //------------------------------------------------------------------------
21 //------------------------------------------------------------------------
26 // Initialize the decryptor object.
27 Decrypt(Guchar *fileKey, int keyLength, int objNum, int objGen);
33 Guchar decryptByte(Guchar c);
35 // Generate a file key. The <fileKey> buffer must have space for at
36 // least 16 bytes. Checks <ownerPassword> and then <userPassword>
37 // and returns true if either is correct. Sets <ownerPasswordOk> if
38 // the owner password was correct. Either or both of the passwords
39 // may be NULL, which is treated as an empty string.
40 static GBool makeFileKey(int encVersion, int encRevision, int keyLength,
41 GString *ownerKey, GString *userKey,
42 int permissions, GString *fileID,
43 GString *ownerPassword, GString *userPassword,
44 Guchar *fileKey, GBool *ownerPasswordOk);
48 static GBool makeFileKey2(int encVersion, int encRevision, int keyLength,
49 GString *ownerKey, GString *userKey,
50 int permissions, GString *fileID,
51 GString *userPassword, Guchar *fileKey);