---
url: /flow/guide/scripting-reference/functions/encryption/rc4encryptkey.md
---

# RC4EncryptKey

## Declaration

`Function RC4EncryptKey( Input : string; aKey : string) : String`

### Example

```pascal
procedure OnMapEvent(var Value:Variant);
begin
  Value := RC4EncryptKey('cameron','d5(f7329f&gksh!s''k8w0'); //value will be encrypted using the unique key
end;
```

## Description

Encrypts the value using RC4 with the unique key provided. This key will be preprocessed for use with RC4. The resulting value will only be able to be decrypted using [RC4DecryptKey](/flow/guide/scripting-reference/functions/encryption/rc4decryptkey) function and passing the same key value.
