Software: Apache/2.4.53 (Unix) OpenSSL/1.1.1o PHP/7.4.29 mod_perl/2.0.12 Perl/v5.34.1. PHP/7.4.29 uname -a: Linux vps-2738122-x 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 uid=1(daemon) gid=1(daemon) grupos=1(daemon) Safe-mode: OFF (not secure) /opt/lampp/share/doc/openssl/html/man3/ drwxr-xr-x | |
| Viewing file: Select action/file-type:
NAMEEVP_PKEY_CTX_set_hkdf_md, EVP_PKEY_CTX_set1_hkdf_salt, EVP_PKEY_CTX_set1_hkdf_key, EVP_PKEY_CTX_add1_hkdf_info, EVP_PKEY_CTX_hkdf_mode - HMAC-based Extract-and-Expand key derivation algorithm SYNOPSIS
DESCRIPTIONThe EVP_PKEY_HKDF algorithm implements the HKDF key derivation function. HKDF follows the "extract-then-expand" paradigm, where the KDF logically consists of two modules. The first stage takes the input keying material and "extracts" from it a fixed-length pseudorandom key K. The second stage "expands" the key K into several additional pseudorandom keys (the output of the KDF). EVP_PKEY_CTX_hkdf_mode() sets the mode for the HKDF operation. There are three modes that are currently defined:
EVP_PKEY_CTX_set_hkdf_md() sets the message digest associated with the HKDF. EVP_PKEY_CTX_set1_hkdf_salt() sets the salt to saltlen bytes of the buffer salt. Any existing value is replaced. EVP_PKEY_CTX_set1_hkdf_key() sets the key to keylen bytes of the buffer key. Any existing value is replaced. EVP_PKEY_CTX_add1_hkdf_info() sets the info value to infolen bytes of the buffer info. If a value is already set, it is appended to the existing value. STRING CTRLSHKDF also supports string based control operations via EVP_PKEY_CTX_ctrl_str(3). The type parameter "md" uses the supplied value as the name of the digest algorithm to use. The type parameter "mode" uses the values "EXTRACT_AND_EXPAND", "EXTRACT_ONLY" and "EXPAND_ONLY" to determine the mode to use. The type parameters "salt", "key" and "info" use the supplied value parameter as a seed, key or info value. The names "hexsalt", "hexkey" and "hexinfo" are similar except they take a hex string which is converted to binary. NOTESAll these functions are implemented as macros. A context for HKDF can be obtained by calling:
The total length of the info buffer cannot exceed 1024 bytes in length: this should be more than enough for any normal use of HKDF. The output length of an HKDF expand operation is specified via the length parameter to the EVP_PKEY_derive(3) function. Since the HKDF output length is variable, passing a NULL buffer as a means to obtain the requisite length is not meaningful with HKDF in any mode that performs an expand operation. Instead, the caller must allocate a buffer of the desired length, and pass that buffer to EVP_PKEY_derive(3) along with (a pointer initialized to) the desired length. Passing a NULL buffer to obtain the length is allowed when using EVP_PKEY_HKDEF_MODE_EXTRACT_ONLY. Optimised versions of HKDF can be implemented in an ENGINE. RETURN VALUESAll these functions return 1 for success and 0 or a negative value for failure. In particular a return value of -2 indicates the operation is not supported by the public key algorithm. EXAMPLESThis example derives 10 bytes using SHA-256 with the secret key "secret", salt value "salt" and info value "label":
CONFORMING TORFC 5869 SEE ALSOEVP_PKEY_CTX_new(3), EVP_PKEY_CTX_ctrl_str(3), EVP_PKEY_derive(3) COPYRIGHTCopyright 2016-2019 The OpenSSL Project Authors. All Rights Reserved. Licensed under the OpenSSL license (the "License"). You may not use this file except in compliance with the License. You can obtain a copy in the file LICENSE in the source distribution or at https://www.openssl.org/source/license.html. |
:: Command execute :: | |
--[ c99shell v. 2.1 [PHP 8 Update] [02.02.2022] maintained byC99Shell Github | Generation time: 0.4841 ]-- |