39 #ifndef HPDF_ENCRYPT_H
40 #define HPDF_ENCRYPT_H
51 #define HPDF_ID_LEN 16
52 #define HPDF_PASSWD_LEN 32
53 #define HPDF_ENCRYPT_KEY_MAX 16
54 #define HPDF_MD5_KEY_LEN 16
55 #define HPDF_PERMISSION_PAD 0xFFFFFFC0
56 #define HPDF_ARC4_BUF_SIZE 256
void HPDF_MD5Init(struct HPDF_MD5Context *ctx)
void HPDF_Encrypt_CreateEncryptionKey(HPDF_Encrypt attr)
#define HPDF_ARC4_BUF_SIZE
Definition: hpdf_encrypt.h:56
struct _HPDF_Encrypt_Rec HPDF_Encrypt_Rec
void HPDF_Encrypt_CryptBuf(HPDF_Encrypt attr, const HPDF_BYTE *src, HPDF_BYTE *dst, HPDF_UINT len)
void HPDF_MD5Update(struct HPDF_MD5Context *ctx, const HPDF_BYTE *buf, HPDF_UINT32 len)
void HPDF_Encrypt_CreateOwnerKey(HPDF_Encrypt attr)
void HPDF_Encrypt_InitKey(HPDF_Encrypt attr, HPDF_UINT32 object_id, HPDF_UINT16 gen_no)
void HPDF_MD5Final(HPDF_BYTE digest[16], struct HPDF_MD5Context *ctx)
void HPDF_PadOrTrancatePasswd(const char *pwd, HPDF_BYTE *new_pwd)
#define HPDF_ID_LEN
Definition: hpdf_encrypt.h:51
#define HPDF_MD5_KEY_LEN
Definition: hpdf_encrypt.h:54
void HPDF_Encrypt_CreateUserKey(HPDF_Encrypt attr)
#define HPDF_PASSWD_LEN
Definition: hpdf_encrypt.h:52
struct _HPDF_Encrypt_Rec * HPDF_Encrypt
Definition: hpdf_encrypt.h:74
void HPDF_Encrypt_Reset(HPDF_Encrypt attr)
struct _HPDF_ARC4_Ctx_Rec HPDF_ARC4_Ctx_Rec
struct HPDF_MD5Context HPDF_MD5_CTX
void HPDF_Encrypt_Init(HPDF_Encrypt attr)
signed int HPDF_INT
Definition: hpdf_types.h:44
unsigned short HPDF_UINT16
Definition: hpdf_types.h:63
unsigned int HPDF_UINT
Definition: hpdf_types.h:45
unsigned int HPDF_UINT32
Definition: hpdf_types.h:57
enum _HPDF_EncryptMode HPDF_EncryptMode
unsigned char HPDF_BYTE
Definition: hpdf_types.h:74
Definition: hpdf_encrypt.h:60
HPDF_BYTE in[64]
Definition: hpdf_encrypt.h:63
HPDF_UINT32 bits[2]
Definition: hpdf_encrypt.h:62
HPDF_UINT32 buf[4]
Definition: hpdf_encrypt.h:61
Definition: hpdf_encrypt.h:67
HPDF_BYTE idx2
Definition: hpdf_encrypt.h:69
HPDF_BYTE idx1
Definition: hpdf_encrypt.h:68
HPDF_BYTE state[HPDF_ARC4_BUF_SIZE]
Definition: hpdf_encrypt.h:70
Definition: hpdf_encrypt.h:76
HPDF_BYTE user_key[HPDF_PASSWD_LEN]
Definition: hpdf_encrypt.h:92
HPDF_BYTE md5_encryption_key[HPDF_MD5_KEY_LEN]
Definition: hpdf_encrypt.h:97
HPDF_INT permission
Definition: hpdf_encrypt.h:94
HPDF_ARC4_Ctx_Rec arc4ctx
Definition: hpdf_encrypt.h:98
HPDF_BYTE owner_passwd[HPDF_PASSWD_LEN]
Definition: hpdf_encrypt.h:83
HPDF_BYTE owner_key[HPDF_PASSWD_LEN]
Definition: hpdf_encrypt.h:89
HPDF_UINT key_len
Definition: hpdf_encrypt.h:80
HPDF_BYTE user_passwd[HPDF_PASSWD_LEN]
Definition: hpdf_encrypt.h:86
HPDF_BYTE encryption_key[HPDF_MD5_KEY_LEN+5]
Definition: hpdf_encrypt.h:96
HPDF_EncryptMode mode
Definition: hpdf_encrypt.h:77
HPDF_BYTE encrypt_id[HPDF_ID_LEN]
Definition: hpdf_encrypt.h:95