DerivedKey

DerivedKey[assoc]

represents a derived key generated by GenerateDerivedKey.

Details

  • DerivedKey is an object containing a secure key, which can be used in place of a plain-text password.
  • DerivedKey contains all the information necessary to verify the password used to generate the key.
  • In DerivedKey[assoc], the association assoc contains the following:
  • "Function"key derivation function used
    "Parameters"arguments of the key derivation function
    "DerivedKey"derived key
    "Salt"salt used to derive the key
  • The value of "Parameters" is an Association that contains "KeySize" and parameters specific to the key derivation function used.
  • DerivedKey[assoc]["prop"] gives the specified element of assoc; it is equivalent to assoc["prop"].
  • DerivedKey[assoc]["PHCString"] gives a string representation of the derived key.

Examples

Basic Examples  (7)

Generate a derived key:

In[1]:=
Click for copyable input
Out[1]=

Extract the derived sequence of bytes:

In[1]:=
Click for copyable input
Out[1]=

Extract the name of the key derivation function used:

In[1]:=
Click for copyable input
Out[1]=

Extract key derivation function parameters:

In[1]:=
Click for copyable input
Out[1]=

Obtain derived key as a hex string:

In[1]:=
Click for copyable input
Out[1]=
Out[1]=

Verify password using DerivedKey:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
In[3]:=
Click for copyable input
Out[3]=

Verify password using hex string representation of DerivedKey:

In[1]:=
Click for copyable input
Out[1]=
In[2]:=
Click for copyable input
Out[2]=
Introduced in 2019
(12.0)