00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef DECRYPT_H
00010 #define DECRYPT_H
00011
00012 #include <aconf.h>
00013
00014 #ifdef USE_GCC_PRAGMAS
00015 #pragma interface
00016 #endif
00017
00018 #include "gtypes.h"
00019 #include "GString.h"
00020
00021
00022
00023
00024
00025 class Decrypt {
00026 public:
00027
00028
00029 Decrypt(Guchar *fileKey, int keyLength, int objNum, int objGen);
00030
00031
00032 void reset();
00033
00034
00035 Guchar decryptByte(Guchar c);
00036
00037
00038
00039
00040
00041
00042 static GBool makeFileKey(int encVersion, int encRevision, int keyLength,
00043 GString *ownerKey, GString *userKey,
00044 int permissions, GString *fileID,
00045 GString *ownerPassword, GString *userPassword,
00046 Guchar *fileKey, GBool *ownerPasswordOk);
00047
00048 private:
00049
00050 static GBool makeFileKey2(int encVersion, int encRevision, int keyLength,
00051 GString *ownerKey, GString *userKey,
00052 int permissions, GString *fileID,
00053 GString *userPassword, Guchar *fileKey);
00054
00055 int objKeyLength;
00056 Guchar objKey[21];
00057 Guchar state[256];
00058 Guchar x, y;
00059 };
00060
00061 #endif