Wolfram Language & System 11.0 (2016)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

PrivateKey

PrivateKey[assoc]
represents the private part of a key pair for a public-key cryptographic system.

DetailsDetails

  • PrivateKey objects can be used with functions such as Encrypt and Decrypt.
  • Data can only be decrypted with a particular PrivateKey object if it was encrypted with the corresponding PublicKey object.
  • Corresponding pairs of PrivateKey and PublicKey objects can be generated with GenerateAsymmetricKeyPair.
  • In PrivateKey[assoc], the association assoc contains the following:
  • "Cipher"cipher used
    "PublicExponent"public exponent
    "PublicModulus"public modulus
    "PrivateExponent"private exponent
    "PaddingMode"padding mode

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Generate public and private keys:

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

Encrypt using the public key:

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

Decrypt using the private key:

In[3]:=
Click for copyable input
Out[3]=
Introduced in 2015
(10.1)