2 // F.2.1 (CBC-AES128.Encrypt)
3 // http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
6 "key": "2b7e151628aed2a6abf7158809cf4f3c",
7 "iv": "000102030405060708090a0b0c0d0e0f",
8 "plain_text": "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be66c3710",
9 // Added a padding block: encryption of {0x10, 0x10, ... 0x10}) (not given by the
11 "cipher_text": "7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18cc2012"
14 // F.2.6 CBC-AES256.Decrypt [*]
15 // http://csrc.nist.gov/publications/nistpubs/800-38a/sp800-38a.pdf
17 // [*] Truncated 3 bytes off the plain text, so block 4 differs from the
21 "key": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4",
22 "iv": "000102030405060708090a0b0c0d0e0f",
23 // Truncated the last block to make it more interesting.
24 "plain_text": "6bc1bee22e409f96e93d7e117393172aae2d8a571e03ac9c9eb76fac45af8e5130c81c46a35ce411e5fbc1191a0a52eff69f2445df4f9b17ad2b417be6",
25 // Last block differs from source vector (due to truncation)
26 "cipher_text": "f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461c9aaf02a6a54e9e242ccbf48c59daca6"
29 // Taken from encryptor_unittest.cc (EncryptorTest.EmptyEncrypt())
32 "key": "3132383d5369787465656e4279746573",
33 "iv": "5377656574205369787465656e204956",
35 "cipher_text": "8518b8878d34e7185e300d0fcc426396"
38 // Fail encrypting because the IV is too small.
41 "key": "3132383d5369787465656e4279746573",
44 "encrypt_error": "OperationError: The \"iv\" has an unexpected length -- must be 16 bytes"
47 // Fail decrypting because the IV is too small.
50 "key": "3132383d5369787465656e4279746573",
52 "cipher_text": "8518b8878d34e7185e300d0fcc426396",
53 "decrypt_error": "OperationError: The \"iv\" has an unexpected length -- must be 16 bytes"
56 // Fail encrypting because the IV is too large.
59 "key": "3132383d5369787465656e4279746573",
60 "iv": "5377656574205369787465656e2049560000000000000000",
62 "encrypt_error": "OperationError: The \"iv\" has an unexpected length -- must be 16 bytes"
65 // Fail decrypting because the IV is too large.
68 "key": "3132383d5369787465656e4279746573",
69 "iv": "5377656574205369787465656e2049560000000000000000",
70 "cipher_text": "8518b8878d34e7185e300d0fcc426396",
71 "decrypt_error": "OperationError: The \"iv\" has an unexpected length -- must be 16 bytes"
74 // Fail importing the key because not enough bytes were specified.
78 "import_error": "DataError: AES key data must be 128 or 256 bits"
81 // Fail importing because the wrong format was specified
84 "key": "3132383d5369787465656e4279746573",
85 "import_error": "NotSupported: Unsupported import key format for algorithm"
88 // Fail importing because the wrong format was specified
90 "key_format": "pkcs8",
91 "key": "3132383d5369787465656e4279746573",
92 "import_error": "NotSupported: Unsupported import key format for algorithm"
95 // Fail decrypting an empty cipher text
98 "key": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4",
99 "iv": "000102030405060708090a0b0c0d0e0f",
101 "decrypt_error": "OperationError"
104 // Decrypt a truncated cipher text (removed an entire block).
107 "key": "603deb1015ca71be2b73aef0857d77811f352c073b6108d72d9810a30914dff4",
108 "iv": "000102030405060708090a0b0c0d0e0f",
109 "cipher_text": "f58c4c04d6e5f1ba779eabfb5f7bfbd69cfc4e967edb808d679f777bc6702c7d39f23369a9d9bacfa530e26304231461",
110 "decrypt_error": "OperationError"
113 // Decrypt truncated cipher text (stripped 3 byte).
116 "key": "2b7e151628aed2a6abf7158809cf4f3c",
117 "iv": "000102030405060708090a0b0c0d0e0f",
118 "cipher_text": "7649abac8119b246cee98e9b12e9197d5086cb9b507219ee95db113a917678b273bed6b8e3c1743b7116e69e222295163ff1caa1681fac09120eca307586e1a78cb82807230e1321d3fae00d18",
119 "decrypt_error": "OperationError"
122 // JWK: key_ops has duplicates
127 "k": "GADWrMRHwQfoNaXU5fZvTg",
128 "key_ops": [ "encrypt", "decrypt", "encrypt" ]
130 "import_error": "DataError: The \"key_ops\" member of the JWK dictionary contains duplicate usages."
133 // JWK: key_ops has (unrecognized duplicates)
138 "k": "GADWrMRHwQfoNaXU5fZvTg",
139 "key_ops": [ "foopy", "decrypt", "foopy" ]
141 "import_error": "DataError: The \"key_ops\" member of the JWK dictionary contains duplicate usages."
144 // JWK: alg present but incorrect (expecting A128CBC).
150 "k": "GADWrMRHwQfoNaXU5fZvTg"
152 "import_error": "DataError: The JWK \"alg\" member was inconsistent with that specified by the Web Crypto call"
160 "k": "GADWrMRHwQfoNaXU5fZvTg"
162 "import_error": "DataError: The JWK \"kty\" member was not \"oct\""
169 "k": "GADWrMRHwQfoNaXU5fZvTg"
171 "import_error": "DataError: The required JWK member \"kty\" was missing"
174 // JWK: kty is wrong type
179 "k": "GADWrMRHwQfoNaXU5fZvTg"
181 "import_error": "DataError: The JWK member \"kty\" must be a string"
190 "k": "GADWrMRHwQfoNaXU5fZvTg"
192 "import_error": "DataError: The JWK \"use\" member could not be parsed"
195 // JWK: Invalid use (wrong type)
201 "k": "GADWrMRHwQfoNaXU5fZvTg"
203 "import_error": "DataError: The JWK member \"use\" must be a string"
206 // JWK: Invalid ext (wrong type)
211 "k": "GADWrMRHwQfoNaXU5fZvTg",
214 "import_error": "DataError: The JWK member \"ext\" must be a boolean"
217 // JWK: Invalid key_ops (wrong type)
222 "k": "GADWrMRHwQfoNaXU5fZvTg",
225 "import_error": "DataError: The JWK member \"key_ops\" must be a list"
228 // JWK: unrecognized values in "key_ops". This is OK.
233 "k": "GADWrMRHwQfoNaXU5fZvTg",
234 "key_ops": ["foo", "bar", "encrypt", "decrypt"]
238 // JWK: non-string entry in key_ops
243 "k": "GADWrMRHwQfoNaXU5fZvTg",
244 "key_ops": ["encrypt", 3]
246 "import_error": "DataError: The JWK member \"key_ops[1]\" must be a string"
255 "import_error": "DataError: The required JWK member \"k\" was missing"
258 // JWK: Bad Base64 encoding for k
263 "k": "Qk3f0DsytU8lfza2au #$% Htaw2xpop9GYyTuH0p5GghxTI="
265 "import_error": "DataError: The JWK member \"k\" could not be base64url decoded or contained padding"
275 "import_error": "DataError: AES key data must be 128 or 256 bits"
278 // JWK: empty k (with alg specified)
286 "import_error": "DataError: The JWK \"k\" member did not include the right length of key data for the given algorithm."
289 // JWK: k actual length (120 bits) inconsistent with alg (128 bits)
295 "k": "AVj42h0Y5aqGtE3yluKL"
297 "import_error": "DataError: The JWK \"k\" member did not include the right length of key data for the given algorithm."
300 // JWK: k actual length (192 bits) inconsistent with alg (128 bits)
306 "k": "dGhpcyAgaXMgIDI0ICBieXRlcyBsb25n"
308 "import_error": "DataError: The JWK \"k\" member did not include the right length of key data for the given algorithm."
311 // AES 192-bit is not allowed: http://crbug.com/381829
314 "key": "5377656574205369787465656e2049560000000000000000",
315 "import_error": "OperationError: 192-bit AES keys are not supported"
318 // JWK: AES 192-bit is not allowed: http://crbug.com/381829
324 "k": "YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh"
326 "import_error": "OperationError: 192-bit AES keys are not supported"