Use Asymmetric Key Cryptography
Asymmetric key encryption requires the generation of a public and private key, allowing the message to be encrypted with a "public" key but only decrypted using a "private" key.
Generate an asymmetric key pair.
In[1]:=
keys = GenerateAsymmetricKeyPair[]
Out[1]=
Encrypt the message using the public key.
In[2]:=
encrypted =
Encrypt[keys["PublicKey"],
"The gold is located off the coast of Honduras."]
Out[2]=
The message cannot be decrypted using the public key that encrypted it. The private key must be used.
In[3]:=
Decrypt[keys["PublicKey"], encrypted]
Out[3]=
In[4]:=
Decrypt[keys["PrivateKey"], encrypted]
Out[4]=