BlockEncrypt

(System Library)

Description: Uses encryption to encode a VTScada value into a Base64 string.
Returns: String
Usage: Script Only.
Function Groups: Encryption
Related to: BlockDecrypt | Encode | Base64Encode | Hash
Format: System.BlockEncrypt(PlainValue, Key[, Salt, CryptoVersion, HashKey]);
Parameters:  
PlainValue
Required. The information to be encoded.
Key
Required string. The key value to be used for encryption.
Salt
Optional text. Defaults to a random GUID, but can be specified by the caller if required. Best practice is to use a per-record salt
CryptoVersion
Optional numeric. The version of the cryptography method to use.
Only 0 and 1 are valid values. See comments.
HashKey
Optional text. The key to hash the encrypted data. Will be ignored if CryptoVersion is not 1.
Comments:

The resulting string will be different each time it is encoded, even if the same key is used.

See the property CryptoVersion to determine the CryptoVersion for your application.

See: Cryptography Version Upgrade for more information.

Examples:

  EncodedResult = System.BlockEncrypt(SomeValue, SomeKey);