Re-keying Mechanisms for Symmetric Keys
CryptoPro18, Suschevsky val Moscow127018Russian Federation+7 (495) 995-48-20svs@cryptopro.ruVigil Security, LLC918 Spring Knoll DriveHerndonVA 20170USAhousley@vigilsec.comUniversity of California, San Diego9500 Gilman DriveLa JollaCalifornia 92093-0404USA(858) 534-4544mihir@eng.ucsd.eduCryptoPro18, Suschevsky val Moscow127018Russian Federation+7 (495) 995-48-20alekseev@cryptopro.ruCryptoPro18, Suschevsky val Moscow127018Russian Federation+7 (495) 995-48-20ess@cryptopro.ruAkamai Technologies150 BroadwayCambridgeMA 02142-1413USAdfoxfranke@gmail.comCryptoPro18, Suschevsky val Moscow127018Russian Federation+7 (495) 995-48-20lah@cryptopro.ruUniversity of California, San Diego9500 Gilman DriveLa JollaCalifornia 92093-0404USAring@eng.ucsd.edu
General
CFRGre-keying, key, meshing
This specification contains a description of a variety of methods to increase the lifetime of symmetric keys.
It provides external and internal re-keying mechanisms that can be used with such modes of operations as CTR, GCM, CBC, CFB, OFB and OMAC.
Common attacks base their success on the ability to get many
encryptions under a single key. If encryption is performed under a single key, there is a certain maximum
threshold number of messages that can be safely encrypted. These restrictions can come either from combinatorial
properties of the used cipher modes of operation (for example, birthday attack
) or from particular cryptographic attacks on the used
block cipher (for example, linear cryptanalysis ). Moreover,
most strict restrictions here follow from the need to resist side-channel attacks. The adversary’s opportunity
to obtain an essential amount of data processed with a single key leads not only to
theoretic but also to practical vulnerabilities (see ).
Therefore, when the total size of a plaintext
processed with a single key reaches threshold values, this key cannot be used
anymore and certain procedures with encryption keys are needed.
The most simple and obvious way for overcoming the key lifetimes
limitations is a renegotiation of a regular session key. However,
this reduces the total performance since it usually
entails the frequent use of a public key cryptography.
Another way is to use a transformation of a previously negotiated key.
This specification presents the description of such mechanisms and the
description of the cases when these mechanisms should be applied.
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT",
"RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in
.
This document uses the following terms and definitions for the sets and operations
on the elements of these sets:
exclusive-or of two binary vectors of the same length.
the set of all strings of a finite length
(hereinafter referred to as strings), including the empty
string;
the set of all binary strings of length s, where s is a non-negative
integer; substrings and string components are
enumerated from right to left starting from one;
the bit length of the bit string X;
concatenation of strings A and B both belonging to V*, i.e.,
a string in V_{|A|+|B|}, where the left substring in
V_|A| is equal to A, and the right substring in V_|B| is
equal to B;
ring of residues modulo 2^n;
the transformation that maps a string a = (a_s, ... , a_1), a in V_s,
into the integer Int_s(a) = 2^s*a_s + ... + 2*a_2 + a_1;
the transformation inverse to the mapping Int_s;
the transformation that maps the string a = (a_s, ... , a_1) in V_s,
into the string MSB_i(a) = (a_s, ... , a_{s-i+1}) in V_i;
the transformation that maps the string a = (a_s, ... , a_1) in V_s,
into the string LSB_i(a) = (a_i, ... , a_1) in V_i;
the transformation that maps the string a = (a_s, ... , a_1) in V_s,
into the string Inc_c(a) = MSB_{|a|-c}(a) | Vec_c(Int_c(LSB_c(a)) + 1(mod 2^c)) in V_s;
denotes the string in V_s that consists of s 'a' bits;
the block cipher permutation under the key K in V_k;
the least integer that is not less than x;
the key K size (in bits);
the block size of the block cipher (in bits);
the total number of data blocks in the plaintext (b = ceil(m/n));
the section size (the number of bits in a data section);
the number of data sections in the plaintext;
the message M size (in bits);
the transformation that maps a string a = (a_s, ... , a_1)
into the string phi_i(a) = a' = (a'_s, ... , a'_1), 1 <= i <= s,
such that a'_i = 1 and a'_j = a_j for all j in {1, ... , s}\{i}.
A plaintext message P and a ciphertext C are divided into b = ceil(m/n) segments
denoted as P = P_1 | P_2 | ... | P_b and C = C_1 | C_2 | ... | C_b,
where P_i and C_i are in V_n, for i = 1, 2, ... , b-1, and P_b, C_b are in V_r, where r <= n if not otherwise stated.
This section presents an approach to increase the lifetime of negotiated keys after processing a limited number of integral messages.
It provides an external parallel and serial re-keying mechanisms (see ).
These mechanisms use an initial (negotiated) key as a master key, which is never used
directly for the data processing but is used for key generation.
Such mechanisms operate outside of the base modes of operations and do not change them at all, therefore
they are called "external re-keying" in this document.
The main idea behind external re-keying with parallel construction is presented in Fig.1:
ExtParallelC re-keying mechanism is based on a block cipher and is used to generate t keys for t sections as follows:
K^1 | K^2 | ... | K^t = ExtParallelC(K*, t*k) = MSB_{t*k}(E_{K*}(0) | E_{K*}(1) | ... | E_{K*}(J-1)),
where J = ceil(k/n).
ExtParallelH re-keying mechanism is based on HMAC-based key derivation function HKDF-Expand, described
in , and is used to generate t keys for t sections as follows:
K^1 | K^2 | ... | K^t = ExtParallelH(K*, t*k) = HKDF-Expand(K*, label, t*k),
where label is a string (can be a zero-length string) that is defined by a specific protocol.
The main idea behind external re-keying with serial construction is presented in Fig.2:
The key K^i is calculated using ExtSerialC transformation as follows:
K^i = ExtSerialC(K*, i) = MSB_k(E_{K*_i}(0) | E_{K*_i}(1) | ... | E_{K*_i}(J-1)),
where J = ceil(k/n), i = 1, ... , t, K*_i is calculated as follows:
K*_1 = K*,
K*_{j+1} = MSB_k(E_{K*_j}(J) | E_{K*_j}(J+1) | ... | E_{K*_j}(2J-1)),
where j = 1, ... , t-1.
The key K^i is calculated using ExtSerialH transformation as follows:
K^i = ExtSerialH(K*, i) = HKDF-Expand(K*_i, label1, k),
where i = 1, ... , t, HKDF-Expand is an HMAC-based key derivation function, described in , K*_i is calculated as follows:
K*_1 = K*,
K*_{j+1} = HKDF-Expand(K*_j, label2, k), where j = 1, ... , t-1,
where label1 and label2 are different strings (can be a zero-length strings) that are defined by a specific protocol (see, for example, TLS 1.3 updating traffic keys algorithm ).
This section presents an approach to increase the lifetime of negotiated key by re-keying
during each separate message processing. It provides an
internal re-keying mechanisms called ACPKM and ACPKM-Master that do not use and use a master key respectively.
Such mechanisms are integrated into the base modes of operations
and can be considered as the base mode extensions, therefore
they are called "internal re-keying" in this document.
This section describes the block cipher modes that uses the ACPKM
re-keying mechanism (described in ), which
does not use master key: an initial key is used directly for the encryption of the data.
This section defines periodical key transformation with no master key which is
called ACPKM re-keying mechanism. This mechanism can be applied to one of the
basic encryption modes (CTR and GCM block cipher modes)
for getting an extension of this encryption mode that uses periodical key
transformation with no master key. This extension can be considered as a new encryption mode.
An additional parameter that defines the functioning of basic encryption modes
with the ACPKM re-keying mechanism is the section size N.
The value of N is measured in bits and is fixed within a specific protocol based on the requirements of the system
capacity and key lifetime (some recommendations on choosing N will be provided in ).
The section size N MUST be divisible by the block size n.
The main idea behind internal re-keying with no master key is presented in Fig.3:
During the processing of the input message M with the length m in some encryption mode that
uses ACPKM key transformation of the key K the message is divided into l = ceil(m/N) parts
(denoted as M = M_1 | M_2 | ... | M_l, where M_i is in V_N for i = 1, 2, ... , l-1 and M_l is in V_r, r <= N).
The first section is processed with the initial key K^1 = K. To process the (i+1)-th section the K^{i+1} key value
is calculated using ACPKM transformation as follows:
K^{i+1} = ACPKM(K^i) = MSB_k(E_{K^i}(W_1) | ... | E_{K^i}(W_J)),
where J = ceil(k/n), W_t = phi_c(D_t) for any t in {1, ... ,J} and D_1, D_2, ... , D_J
are in V_n and are calculated as follows:
D_1 | D_2 | ... | D_J = MSB_{J*n}(D),
where D is the following constant in V_{1024}:
N o t e : The constant D is such that phi_c(D_1), ... , phi_c(D_J) are pairwise different for any allowed n, k, c values.
N o t e : The constant D is such that D = sha512(streebog512(0^1024)) | sha512(streebog512(1^1024)), where
sha512 is a hash function with 512-bit output corresponding to the algorithm SHA-512 ,
streebog512 is a hash function with 512-bit output, corresponding to the algorithm GOST R 34.11-2012 , .
This section defines a CTR-ACPKM encryption mode that uses internal ACPKM re-keying
mechanism for the periodical key transformation.
The CTR-ACPKM mode can be considered as the extended by the ACPKM re-keying mechanism basic encryption mode CTR (see ).
The CTR-ACPKM encryption mode can be used with the following parameters:
64 <= n <= 512; 128 <= k <= 512;
the number of bits c in a specific part of the block to be incremented
is such that 32 <= c <= 3/4 n.
The CTR-ACPKM mode encryption and decryption procedures are defined as follows:
The initial counter nonce ICN value for each message that is encrypted under the given key must be
chosen in a unique manner.
The message size m MUST NOT exceed n * 2^{c-1} bits.
This section defines a GCM-ACPKM encryption mode that uses internal ACPKM re-keying mechanism for the periodical key transformation.
The GCM-ACPKM mode can be considered as the extended by the ACPKM re-keying mechanism basic encryption mode GCM (see ).
The GCM-ACPKM encryption mode can be used with the following parameters:
n in {128, 256}; 128 <= k <= 512;
the number of bits c in a specific part of the block to be incremented
is such that 32 <= c <= 3/4 n;
authentication tag length t.
The GCM-ACPKM mode encryption and decryption procedures are defined as follows:
The * operation on (pairs of) the 2^n possible blocks corresponds to the multiplication operation
for the binary Galois (finite) field of 2^n elements defined by the polynomial f as follows (by analogy with ):
f = a^128 + a^7 + a^2 + a^1 + 1.
f = a^256 + a^10 + a^5 + a^2 + 1.
The initial vector IV value for each message that is encrypted under the given key must be
chosen in a unique manner.
The message size m MUST NOT exceed n*(2^{c-1} - 2) bits.
The key for computing values E_{K}(ICB_0) and H is not updated and is
equal to the initial key K.
This section describes the block cipher modes that uses the ACPKM-Master
re-keying mechanism (described in ), which
use the initial key K as a master key K*, so K is never used directly for the data processing but is
used for key derivation.
This section defines periodical key transformation with master key K* which is
called ACPKM-Master re-keying mechanism. This mechanism can be applied to one of the basic encryption modes (CTR, GCM, CBC, CFB, OFB, OMAC encryption modes)
for getting an extension of this encryption mode that uses periodical key transformation with master key. This extension can be considered as a new encryption mode.
Additional parameters that defines the functioning of basic encryption modes
with the ACPKM-Master re-keying mechanism are the section size N and change frequency T* of the key K*.
The values of N and T* are measured in bits and are fixed within a specific protocol based on the requirements of the system
capacity and key lifetime (some recommendations on choosing N and T* will be provided in ).
The section size N MUST be divisible by the block size n. The key frequency T* MUST be divisible by n.
The main idea behind internal re-keying with master key is presented in Fig.4:
During the processing of the input message M with the length m in some encryption mode that
uses ACPKM-Master key transformation with the master key K* and key frequency T*
the message M is divided into l = ceil(m/N) parts (denoted as M = M_1 | M_2 | ... | M_l, where M_i is in V_N
for i in {1, 2, ... , l-1} and M_l is in V_r, r <= N). The j-th section is processed
with the key material K[j], j in {1, ... ,l}, |K[j]| = d, that has been calculated with the ACPKM-Master algorithm as follows:
IV = 1^{n/2},
K[1] | ... | K[l] = ACPKM-Master(T*, K*, d*l) = CTR-ACPKM-Encrypt (T*, K*, IV, 0^{d*l}).
This section defines a CTR-ACPKM-Master encryption mode that uses internal ACPKM-Master re-keying
mechanism for the periodical key transformation.
The CTR-ACPKM-Master encryption mode can be considered as the extended by the ACPKM-Master re-keying mechanism basic encryption mode CTR (see ).
The CTR-ACPKM-Master encryption mode can be used with the following parameters:
64 <= n <= 512; 128 <= k <= 512;
the number of bits c in a specific part of the block to be incremented
is such that 32 <= c <= 3/4 n.
The key material K[j] that is used for one section processing is equal to K^j, |K^j| = k bits.
The CTR-ACPKM-Master mode encryption and decryption procedures are defined as follows:
The initial counter nonce ICN value for each message that is encrypted under the given key must be
chosen in a unique manner. The counter (CTR_{i+1}) value does not change during key transformation.
The message size m MUST NOT exceed (2^{n/2-1}*n*N / k) bits.
This section defines a GCM-ACPKM-Master encryption mode that uses internal ACPKM-Master re-keying
mechanism for the periodical key transformation.
The GCM-ACPKM-Master encryption mode can be considered as the extended by the ACPKM-Master re-keying mechanism basic encryption mode GCM (see ).
The GCM-ACPKM-Master encryption mode can be used with the following parameters:
n in {128, 256}; 128 <= k <= 512;
the number of bits c in a specific part of the block to be incremented
is such that 32 <= c <= 3/4 n;
authentication tag length t.
The key material K[j] that is used for one section processing is equal to K^j, |K^j| = k bits, that is calculated as follows:
K^1 | ... | K^j | ... | K^l = ACPKM-Master(T*, K*, k*l).
The GCM-ACPKM-Master mode encryption and decryption procedures are defined as follows:
The * operation on (pairs of) the 2^n possible blocks corresponds to the multiplication operation
for the binary Galois (finite) field of 2^n elements defined by the polynomial f as follows (by analogy with ):
f = a^128 + a^7 + a^2 + a^1 + 1.
f = a^256 + a^10 + a^5 + a^2 + 1.
The initial vector IV value for each message that is encrypted under the given key must be
chosen in a unique manner.
The message size m MUST NOT exceed (2^{n/2-1}*n*N / k) bits.
This section defines a CBC-ACPKM-Master encryption mode that uses internal ACPKM-Master re-keying
mechanism for the periodical key transformation.
The CBC-ACPKM-Master encryption mode can be considered as the extended by the ACPKM-Master re-keying mechanism basic encryption mode CBC (see ).
The CBC-ACPKM-Master encryption mode can be used with the following parameters:
64 <= n <= 512; 128 <= k <= 512.
In the specification of the CBC-ACPKM-Master mode the plaintext and ciphertext must be a sequence of one or more complete data blocks.
If the data string to be encrypted does not initially satisfy this property, then it MUST be padded to form complete data blocks.
The padding methods are outside the scope of this document. An example of a padding method can be found in Appendix A of .
The key material K[j] that is used for one section processing is equal to K^j, |K^j| = k bits.
We will denote by D_{K} the decryption function which is a permutation inverse to the E_{K}.
The CBC-ACPKM-Master mode encryption and decryption procedures are defined as follows:
The initialization vector IV for each message that is encrypted under the given key need not to be
secret, but must be unpredictable.
The message size m MUST NOT exceed (2^{n/2-1}*n*N / k) bits.
This section defines a CFB-ACPKM-Master encryption mode that uses internal ACPKM-Master re-keying
mechanism for the periodical key transformation.
The CFB-ACPKM-Master encryption mode can be considered as the extended by the ACPKM-Master re-keying mechanism basic encryption mode CFB (see ).
The CFB-ACPKM-Master encryption mode can be used with the following parameters:
64 <= n <= 512; 128 <= k <= 512.
The key material K[j] that is used for one section processing is equal to K^j, |K^j| = k bits.
The CFB-ACPKM-Master mode encryption and decryption procedures are defined as follows:
The initialization vector IV for each message that is encrypted under the given key need not to be
secret, but must be unpredictable.
The message size m MUST NOT exceed 2^{n/2-1}*n*N/k bits.
This section defines an OFB-ACPKM-Master encryption mode that uses internal ACPKM-Master re-keying
mechanism for the periodical key transformation.
The OFB-ACPKM-Master encryption mode can be considered as the extended by the ACPKM-Master re-keying mechanism basic encryption mode OFB (see ).
The OFB-ACPKM-Master encryption mode can be used with the following parameters:
64 <= n <= 512; 128 <= k <= 512.
The key material K[j] used for one section processing is equal to K^j, |K^j| = k bits.
The OFB-ACPKM-Master mode encryption and decryption procedures are defined as follows:
The initialization vector IV for each message that is encrypted under the given key need not be
unpredictable, but it must be a nonce that is unique to each execution of the encryption operation.
The message size m MUST NOT exceed 2^{n/2-1}*n*N / k bits.
This section defines an OMAC-ACPKM-Master message authentication code calculation mode that uses internal ACPKM-Master re-keying
mechanism for the periodical key transformation.
The OMAC-ACPKM-Master encryption mode can be considered as the extended by the ACPKM-Master re-keying mechanism basic message authentication code calculation mode OMAC (see ).
The OMAC-ACPKM-Master message authentication code calculation mode can be used with the following parameters:
n in {64, 128, 256}; 128 <= k <= 512.
The key material K[j] that is used for one section processing is equal to K^j | K^j_1, where |K^j| = k and |K^j_1| = n.
The following is a specification of the subkey generation process of OMAC:
Where R_n takes the following values:
n = 64: R_{64} = 0^{59} | 11011; n = 128: R_{128} = 0^{120} | 10000111; n = 256: R_{256} = 0^{145} | 10000100101.
The OMAC-ACPKM-Master message authentication code calculation mode is defined as follows:
The message size m MUST NOT exceed 2^{n/2}*n^2*N / (k + n) bits.
Any mechanism described in can be used with any mechanism described in .
External re-keying mechanism is RECOMMENDED to be used in protocols that process pretty small messages (e.g. TLS).
Internal re-keying mechanism is RECOMMENDED to be used in protocols that can process large messages (e.g. IPSec).
For the protocols that process messages of different lengths it is RECOMMENDED to use joint methods described in .
Re-keying should be used to increase "a priori" security properties of ciphers in hoslile environments (e.g. with side-channel adversaries).
If some non-negligible attacks are known for a cipher, it MUST NOT be used. So re-keying can not be used as a patch for vulnerable ciphers.
Base cipher properties must be well analyzed, because security of re-keying mechanisms is based on security of a block cipher as a pseudorandom function.
The Transport Layer Security (TLS) Protocol Version 1.3
Information technology. Cryptographic Data Security. Hashing function
Federal Agency on Technical Regulating and Metrology (In Russian)
The Galois/Counter Mode of Operation (GCM)
McGrew, D. and J. Viega
Recommendation for Block Cipher Modes of Operation: Methods and Techniques
Dworkin, M.
Secure Hash Standard
National Institute of Standards and Technology.
Linear Cryptanalysis Method for DES Cipher
Matsui M.
A concrete security treatment of symmetric encryption
Bellare M., Desai A., Jokipii E., Rogaway P.
On the Practical (In-)Security of 64-bit Block Ciphers: Collision Attacks on HTTP over TLS and OpenVPN
Bhargavan K., Leurent G.
Increasing the Lifetime of a Key: A Comparative Analysis of the Security of Re-keying Techniques
Michel Abdalla and Mihir Bellare