encrypt(
encrypt(
DATA
,
PASSWORD
)

The encrypt( function encrypts data.

Parameters

This function has two parameters:

data – the data to be encrypted. This parameter should contain binary data, however, if text is passed, it will automatically be converted to binary data for you (see Binary Data).

password – the password to be used to encrypt the data. You’ll need this password to later decrypt the data.

Description

This function encrypts binary data (or text). This example encrypts the information in the Letter field (or variable) into a file named Letter.secret, using the password My Secret. (Of course you usually would not want to use a fixed password like this.)

    filesave "Letter.secret",encrypt(Letter,"My Secret")

Later, when you want to decode the secret letter, you would use code like this:

    Letter = decrypt(fileload("Letter.secret"),"My Secret")

If the password used for decrypting doesn’t match the password used for encrypting, an error occurs.

Note: This function encrypts data using AES–256 encryption. See Advanced Encryption Standard for more information.

See Also

- decrypt( -- decrypts data.
- md5( -- calculates the MD5 hash of a binary or text data item.
- sha1( -- calculates the SHA-1 hash of a binary or text data item.
- sha256( -- calculates the SHA-256 hash of a binary or text data item.
- sha512( -- calculates the SHA-512 hash of a binary or text data item.

History

Version | Status | Notes
10.0 | New | New in this version.