Einen Ausdruck mit Encrypt durch ein Passwort schützen
Verschlüsseln Sie eine Nachricht mit dem einfachen Passwort "Shiver me timbers!", woraus sich ein EncryptedObject ergibt.
In[1]:=
![Click for copyable input](assets.de/password-protect-an-expression-with-encrypt/In_22.png)
secretMessage =
Encrypt["Shiver me timbers!", "I buried a stash of gold somewhere."]
Out[1]=
![](assets.de/password-protect-an-expression-with-encrypt/O_17.png)
Die Daten sind nun verschlüsselt.
In[2]:=
![Click for copyable input](assets.de/password-protect-an-expression-with-encrypt/In_23.png)
InputForm[secretMessage]
Out[2]//InputForm=
![](assets.de/password-protect-an-expression-with-encrypt/O_18.png)
Entschlüsseln Sie die Daten mit demselben Passwort.
In[3]:=
![Click for copyable input](assets.de/password-protect-an-expression-with-encrypt/In_24.png)
Decrypt["Shiver me timbers!", secretMessage]
Out[3]=
![](assets.de/password-protect-an-expression-with-encrypt/O_19.png)