New answers tagged

0

How to unwrap an AES(-128) key as DES2 key? Any good PKCS#11 device should make that impossible, and instead produce an error like CKR_WRAPPED_KEY_INVALID. There should be no possible resolution. If such change of key algorithm was possible, it would be a blow to security: it would allow obtaining some plaintext/ciphertext pairs under both the DES2 (3DES ...


2

For this kind of problem, the cryptographic algorithm/protocol designers, usually, presents test vectors for their designs. You can find some of them in books, too. In your case, AES is standardized by NIST on May 26, 2002, and they provide test vectors in Appendix F of NIST 800-38A for various mode of encryption. Before the standardization on November 26, ...


4

So, how do you reveal the first byte of a block, since you’re out of padding length? We are are not out of padding length. However, PKCS#5 (rfc 2898) is defined for 8-byte blocks i.e. for 64 block size like DES, and PKCS#7 (rfc2315) is defined up to 256-byte blocks that covers AES, too. Therefore, for 16-byte blocks, let assume we are using PKCS#7. ...


6

Does PKCS#5 allow you to pad 16 bytes with 0x10 value? No, but that's because PKCS#5 only specifies padding for DES, and that has an 8 byte block size. Even PKCS#5 itself refers to PKCS#7 when it comes to padding AES. More information about the differences here. Now for the real answer. PKCS#7 padding, which is identical to PKCS#5 but allows any block size,...


3

You can indeed avoid having an explicit IV for each chunk in favor of an implicit one, and using the previous encryption's last ciphertext block is indeed one way. But: You almost certainly need authenticated encryption that provides not just confidentiality but also message authenticity. Read up on the EFail attack, one of whose causes is CBC-based ...


1

First of all AES!=Rijndael. I'm assuming that 256 is the key size. Yes, the IV in CBC mode must not be reused, actually, it is more than that, the IV must be unpredictable. Let remember how the encryption in CBC mode is performed; \begin{align} C_1 &= Enc_k(P_1 \oplus IV)\\ C_i &= Enc_k(P_i \oplus C_{i-1}),\;\; 1 < i \leq nb, \end{align} where $...


Top 50 recent answers are included