Protégez une expression par un mot de passe avec Encrypt
Chiffrez un message en utilisant le simple mot de passe « Shiver me timbers! », produisant un EncryptedObject.
In[1]:=
![Click for copyable input](assets.fr/password-protect-an-expression-with-encrypt/In_22.png)
secretMessage =
Encrypt["Shiver me timbers!", "I buried a stash of gold somewhere."]
Out[1]=
![](assets.fr/password-protect-an-expression-with-encrypt/O_17.png)
Les données sont désormais chiffrées.
In[2]:=
![Click for copyable input](assets.fr/password-protect-an-expression-with-encrypt/In_23.png)
InputForm[secretMessage]
Out[2]//InputForm=
![](assets.fr/password-protect-an-expression-with-encrypt/O_18.png)
Déchiffrez les données en utilisant le même mot de passe.
In[3]:=
![Click for copyable input](assets.fr/password-protect-an-expression-with-encrypt/In_24.png)
Decrypt["Shiver me timbers!", secretMessage]
Out[3]=
![](assets.fr/password-protect-an-expression-with-encrypt/O_19.png)