Adobe 12020596 User Guide - Page 20

Algorithm 3.8, Algorithm 3.9, Algorithm 3.10

Page 20 highlights

Adobe Acrobat SDK Adobe® Supplement to the ISO 32000 Syntax (Chapter 3 in PDF Reference) 3.5.2 Standard Security Handler 20 (user password) entries for encryption revision 4 and earlier, and the O, U, OE (owner encryption key), UE (user encryption key) and Perms (permissions) values for encryption revision 5 require more explanation. Algorithms 3.3 through 3.5 show how the values of the owner password and user password are computed for revision 4 and earlier. Algorithms 3.6 and 3.7 show how to determine if a password is valid. Algorithms 3.8 through 3.10 show how the values for revision 5 are computed. Algorithms 3.11 through 3.13 show how to determine if a revision 5 password is valid. Passwords for revision 4 and earlier are up to 32 characters in length, and are limited to characters in the PDFDocEncoding character set (see Appendix D). Following the above paragraphs comes the listing of algorithms 3.3-3.7. These algorithms and accompanying text remain unchanged. Then insert the following paragraphs. In revision 4 and earlier, the result of running the password algorithm was exactly the file encryption key. In revision 5, the file encryption key is decoupled from the password algorithm to make the owner and user keys independent. For the algorithms below, first generate a 256-bit (32 byte) encryption key for the file using a strong random number generator. All passwords for revision 5 are based on Unicode. Preprocessing of a user-entered password consists first of normalizing its representation by applying the "SASLPrep" profile (see RFC 4013) of the "stringprep" algorithm (see RFC 3454) to the supplied password using the Normalize and BIDI options. Next, convert the password string to UTF-8 encoding, and then truncate to the first 127 bytes if the string is longer than 127 bytes. Algorithm 3.8 Computing the encryption dictionary's U (user password) and UE (user encryption key) values 1. Generate 16 random bytes of data using a strong random number generator. The first 8 bytes are the User Validation Salt. The second 8 bytes are the User Key Salt. Compute the 32-byte SHA-256 hash of the password concatenated with the User Validation Salt. The 48-byte string consisting of the 32-byte hash followed by the User Validation Salt followed by the User Key Salt is stored as the U key. 2. Compute the 32-byte SHA-256 hash of the password concatenated with the User Key Salt. Using this hash as the key, encrypt the file encryption key using AES-256 in CBC mode with no padding and an initialization vector of zero. The resulting 32-byte string is stored as the UE key. Algorithm 3.9 Computing the encryption dictionary's O (owner password) and OE (owner encryption key) values 1. Generate 16 random bytes of data using a strong random number generator. The first 8 bytes are the Owner Validation Salt. The second 8 bytes are the Owner Key Salt. Compute the 32-byte SHA-256 hash of the password concatenated with the Owner Validation Salt and then concatenated with the 48-byte U string as generated in Algorithm 3.8. The 48-byte string consisting of the 32-byte hash followed by the Owner Validation Salt followed by the Owner Key Salt is stored as the O key. 2. Compute the 32-byte SHA-256 hash of the password concatenated with the Owner Key Salt and then concatenated with the 48-byte U string as generated in Algorithm 3.8. Using this hash as the key, encrypt the file encryption key using AES-256 in CBC mode with no padding and an initialization vector of zero. The resulting 32-byte string is stored as the OE key. Algorithm 3.10 Computing the encryption dictionary's Perms (permissions) value Fill a 16-byte block as follows:

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
  • 11
  • 12
  • 13
  • 14
  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24
  • 25
  • 26
  • 27
  • 28
  • 29
  • 30
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • 38
  • 39
  • 40
  • 41
  • 42
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • 56
  • 57
  • 58
  • 59
  • 60
  • 61
  • 62
  • 63
  • 64
  • 65
  • 66
  • 67
  • 68
  • 69
  • 70
  • 71
  • 72
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • 84
  • 85
  • 86
  • 87
  • 88
  • 89
  • 90
  • 91
  • 92
  • 93
  • 94
  • 95
  • 96
  • 97
  • 98
  • 99
  • 100
  • 101
  • 102
  • 103
  • 104
  • 105
  • 106
  • 107
  • 108
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • 116
  • 117
  • 118
  • 119
  • 120
  • 121
  • 122
  • 123
  • 124
  • 125
  • 126
  • 127
  • 128
  • 129
  • 130
  • 131
  • 132
  • 133
  • 134
  • 135
  • 136
  • 137
  • 138
  • 139
  • 140

Adobe Acrobat SDK
Syntax (Chapter 3 in PDF Reference)
Adobe® Supplement to the ISO 32000
3.5.2 Standard Security Handler
20
(user password) entries for encryption revision 4 and earlier, and the
O
,
U
,
OE
(owner encryption key),
UE
(user encryption key) and
Perms
(permissions) values for encryption revision 5 require more explanation.
Algorithms 3.3 through 3.5 show how the values of the owner password and user password are computed
for revision 4 and earlier. Algorithms 3.6 and 3.7 show how to determine if a password is valid. Algorithms
3.8 through 3.10 show how the values for revision 5 are computed. Algorithms 3.11 through 3.13 show
how to determine if a revision 5 password is valid.
Passwords for revision 4 and earlier are up to 32 characters in length, and are limited to characters in the
PDFDocEncoding character set (see Appendix D).
Following the above paragraphs comes the listing of algorithms 3.3–3.7. These algorithms and accompanying
text remain unchanged. Then insert the following paragraphs.
In revision 4 and earlier, the result of running the password algorithm was exactly the file encryption key.
In revision 5, the file encryption key is decoupled from the password algorithm to make the owner and
user keys independent. For the algorithms below, first generate a 256-bit (32 byte) encryption key for the
file using a strong random number generator.
All passwords for revision 5 are based on Unicode. Preprocessing of a user-entered password consists first
of normalizing its representation by applying the “SASLPrep” profile (see RFC 4013) of the “stringprep”
algorithm (see RFC 3454) to the supplied password using the
Normalize
and
BIDI
options. Next,
convert the password string to UTF-8 encoding, and then truncate to the first 127 bytes if the string is
longer than 127 bytes.
Algorithm 3.8
Computing the encryption dictionary’s U (user password) and UE (user encryption
key) values
1.
Generate 16 random bytes of data using a strong random number generator. The first 8 bytes are the
User Validation Salt. The second 8 bytes are the User Key Salt. Compute the 32-byte SHA-256 hash of
the password concatenated with the User Validation Salt. The 48-byte string consisting of the 32-byte
hash followed by the User Validation Salt followed by the User Key Salt is stored as the
U
key.
2.
Compute the 32-byte SHA-256 hash of the password concatenated with the User Key Salt. Using this
hash as the key, encrypt the file encryption key using AES-256 in CBC mode with no padding and an
initialization vector of zero. The resulting 32-byte string is stored as the
UE
key.
Algorithm 3.9
Computing the encryption dictionary’s O (owner password) and OE (owner
encryption key) values
1.
Generate 16 random bytes of data using a strong random number generator. The first 8 bytes are the
Owner Validation Salt. The second 8 bytes are the Owner Key Salt. Compute the 32-byte SHA-256 hash
of the password concatenated with the Owner Validation Salt and then concatenated with the 48-byte
U string as generated in Algorithm 3.8. The 48-byte string consisting of the 32-byte hash followed by
the Owner Validation Salt followed by the Owner Key Salt is stored as the
O
key.
2.
Compute the 32-byte SHA-256 hash of the password concatenated with the Owner Key Salt and then
concatenated with the 48-byte U string as generated in Algorithm 3.8. Using this hash as the key,
encrypt the file encryption key using AES-256 in CBC mode with no padding and an initialization vector
of zero. The resulting 32-byte string is stored as the
OE
key.
Algorithm 3.10
Computing the encryption dictionary’s Perms (permissions) value
Fill a 16-byte block as follows: