Proteja con contraseña una expresión con la función Encrypt
Cifre un mensaje usando la simple contraseña "Shiver me timbers!", produciendo un EncryptedObject.
In[1]:=
![Click for copyable input](assets.es/password-protect-an-expression-with-encrypt/In_22.png)
secretMessage =
Encrypt["Shiver me timbers!", "I buried a stash of gold somewhere."]
Out[1]=
![](assets.es/password-protect-an-expression-with-encrypt/O_17.png)
Los datos ahora han sido cifrados.
In[2]:=
![Click for copyable input](assets.es/password-protect-an-expression-with-encrypt/In_23.png)
InputForm[secretMessage]
Out[2]//InputForm=
![](assets.es/password-protect-an-expression-with-encrypt/O_18.png)
Descifre los datos usando la misma contraseña.
In[3]:=
![Click for copyable input](assets.es/password-protect-an-expression-with-encrypt/In_24.png)
Decrypt["Shiver me timbers!", secretMessage]
Out[3]=
![](assets.es/password-protect-an-expression-with-encrypt/O_19.png)