Windows desktop applications
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

KeyDerivationAlgorithmProvider.AlgorithmName | algorithmName property

Gets the name of the open key derivation function (KDF) algorithm.

Syntax


var algorithmName = keyDerivationAlgorithmProvider.algorithmName;

Property value

Type: String [JavaScript] | System.String [.NET] | Platform::String [C++]

Algorithm name.

Remarks

You must call the OpenAlgorithm method before calling this property.

Examples


public IBuffer SampleDeriveKeyMaterialPbkdf(
    String strAlgName,
    UInt32 targetKeySize,
    UInt32 iterationCount)
{

    // Open the specified algorithm.
    KeyDerivationAlgorithmProvider objKdfProv = KeyDerivationAlgorithmProvider.OpenAlgorithm(strAlgName);

    // Demonstrate how to retrieve the algorithm name.
    String strAlgUsed = objKdfProv.AlgorithmName;

    // Create a buffer that contains the secret used during derivation.
    String strSecret = "MyPassword";
    IBuffer buffSecret = CryptographicBuffer.ConvertStringToBinary(strSecret, BinaryStringEncoding.Utf8);

    // Create a random salt value.
    IBuffer buffSalt = CryptographicBuffer.GenerateRandom(32);

    // Create the derivation parameters.
    KeyDerivationParameters pbkdf2Params = KeyDerivationParameters.BuildForPbkdf2(buffSalt, iterationCount);

    // Create a key from the secret value.
    CryptographicKey keyOriginal = objKdfProv.CreateKey(buffSecret);

    // Derive a key based on the original key and the derivation parameters.
    IBuffer keyMaterial = CryptographicEngine.DeriveKeyMaterial(
        keyOriginal,
        pbkdf2Params,
        targetKeySize);

    // Demonstrate checking the iteration count.
    UInt32 iterationCountOut = pbkdf2Params.IterationCount;

    // Demonstrate returning the derivation parameters to a buffer.
    IBuffer buffParams = pbkdf2Params.KdfGenericBinary;

    // return the KDF key material.
    return keyMaterial;
}


Requirements (Windows 10 device family)

Device family

Universal, introduced version 10.0.10240.0

API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0

Namespace

Windows.Security.Cryptography.Core
Windows::Security::Cryptography::Core [C++]

Metadata

Windows.Foundation.UniversalApiContract.winmd

Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Runtime apps only]

Namespace

Windows.Security.Cryptography.Core
Windows::Security::Cryptography::Core [C++]

Metadata

Windows.winmd

See also

KeyDerivationAlgorithmProvider

 

 

Show:
© 2016 Microsoft