Legato
Legato

GoFiler Legato Script Reference

 

Legato v 1.4j

Application v 5.22b

  

 

Chapter FiveGeneral Functions (continued)

EncryptAsRC4 Function

Overview

The EncryptAsRC4 function encrypts a string or buffer using the RC4 algorithm. The function is a symmetrical as such to decrypt use this function with the appropriate key.

Syntax/Parameters

Syntax

int = EncryptAsRC4 ( parameter key, parameter input, parameter *output, [int size] );

Parameters

key

A string or char array to use as the encryption key. If used as a string, the key size is determine by the first zero-terminating byte. For a character array, the size of the character array is used as the key size.

input

Input buffer of any type except it must be in contiguous storage. See Section 3.7 Contiguous Data for more information. The parameter is treated as a pointer to the area of memory where the variable is held. Strings are an exception in that they must be zero-terminated (see Remarks below).

output

A variable name. It cannot be a literal or a calculated expression value. It can be of any type except it must be in contiguous storage. See Section 3.7 Contiguous Data for more information. The parameter is treated as a pointer to the area of memory where the variable is held. Strings are an exception in that they must be zero-terminated (see Remarks below).

The output buffer must be must be the same size or larger than the input buffer. The resulting value may be in binary form.

size

An optional size specification. If specified, it must be the same or smaller than both the input and output buffers.

Return Value

Returns an int as ERROR_NONE (0) on success or a formatted error code. The RC4 algorithm does not return an error, however, an error will be returned if certain parameters are not correct.

Remarks

EncryptAsRC4 is one of the few functions that will alter the contents of a source parameter. The output variable will be written as the result.

RC4 is a reversible encoding, meaning, to decrypt, simple run the function again on the encrypted data,

RC4 is not a strong encryption method.

Platform Support

Go13, Go16, GoFiler Complete, GoFiler Corporate, GoFiler, GoFiler Lite, GoXBRL

Legato IDE, Legato Basic