Защита пароля при помощи выражения шифровальщика
Зашифруйте сообщение, используя простой пароль "Shiver me timbers!", создавая EncryptedObject.
In[1]:=
![Click for copyable input](assets.ru/password-protect-an-expression-with-encrypt/In_22.png)
secretMessage =
Encrypt["Shiver me timbers!", "I buried a stash of gold somewhere."]
Out[1]=
![](assets.ru/password-protect-an-expression-with-encrypt/O_17.png)
Данные становятся зашифрованными.
In[2]:=
![Click for copyable input](assets.ru/password-protect-an-expression-with-encrypt/In_23.png)
InputForm[secretMessage]
Out[2]//InputForm=
![](assets.ru/password-protect-an-expression-with-encrypt/O_18.png)
Расшифруйте данные, используя тот же самый пароль.
In[3]:=
![Click for copyable input](assets.ru/password-protect-an-expression-with-encrypt/In_24.png)
Decrypt["Shiver me timbers!", secretMessage]
Out[3]=
![](assets.ru/password-protect-an-expression-with-encrypt/O_19.png)