Proteja com senha uma expressão com a função Encrypt
Cifre uma mensagem usando a senha "Shiver me timbers!", produzindo um EncryptedObject.
In[1]:=
![Click for copyable input](assets.pt-br/password-protect-an-expression-with-encrypt/In_22.png)
secretMessage =
Encrypt["Shiver me timbers!", "I buried a stash of gold somewhere."]
Out[1]=
![](assets.pt-br/password-protect-an-expression-with-encrypt/O_17.png)
Agora os dados estão cifrados.
In[2]:=
![Click for copyable input](assets.pt-br/password-protect-an-expression-with-encrypt/In_23.png)
InputForm[secretMessage]
Out[2]//InputForm=
![](assets.pt-br/password-protect-an-expression-with-encrypt/O_18.png)
Para decifrar os dados use a mesma senha.
In[3]:=
![Click for copyable input](assets.pt-br/password-protect-an-expression-with-encrypt/In_24.png)
Decrypt["Shiver me timbers!", secretMessage]
Out[3]=
![](assets.pt-br/password-protect-an-expression-with-encrypt/O_19.png)