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