Encrypt
Verb: encrypt
Available from: <Standard>
Encrypts the entered data according to the chosen encryption.
Syntax
encrypt --source(String) --cipher(Cipher) (Boolean)=success (List<Byte>)=value
Inputs
Script | Designer | Required | AcceptedTypes | Description |
---|---|---|---|---|
--source | Source | Required | Text, List<Byte> | Data used in encryption. |
--cipher | Cipher | Required | Cipher | Encryption used. |
Outputs
Script | Designer | AcceptedTypes | Description |
---|---|---|---|
success | Success | Boolean | "True", if encryption is completed correctly, or "False" if otherwise. |
value | Encrypted Bytes | List<Byte> | Encrypted data. |
Example
Encrypt a message using AES encryption.
defVar --name encryptionAES --type Cipher
defVar --name successCrypt --type Boolean
defVar --name EncryptedBytes --type List --innertype Byte
//Create an AES encryption.
cipherAes --key hsjkdlksjhjkjhgh --iv klsoikjdhyfukjsh encryptionAES=value
//Encrypt the "Hello World" message using previously created encryption: "${ encryptionAES}".
encrypt --source " Hello World " --cipher ${encryptionAES} successCrypt=success encryptedBytes=value
logMessage --message "${successCrypt}" --type "Info"
logMessage --message "${EncryptedBytes}" --type "Info"
//Execution returns as follows:
//True
//[187,104,77,183,136,234,18,167,166,29,203,239,75,102,140,30]
Remarks
If a file is entered by visual mode, only the file path in Source will be encrypted.
In Cipher, a previously declared encryption must be entered.