--- title: "Crypto Actions for Connect" slug: "crypto-actions" description: "This is a list of crypto actions that can be performed within Connect." tags: ["Connect", "Actions"] updated: 2022-06-02T20:33:47Z published: 2022-06-02T20:33:47Z canonical: "help.rapididentity.com/crypto-actions" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.rapididentity.com/llms.txt > Use this file to discover all available pages before exploring further. # Crypto Actions ## Crypto Actions ### cryptPassword Encrypt a password ala Unix crypt. | Property | Value | Description | | --- | --- | --- | | password* | expression, variable | password to encrypt | | algorithm | choice (DES, MD5), text, expression, variable | crypt algorithm (default: MD5 if salt begins with $1$, DES otherwise | | salt | text, expression, variable | the salt string (default: randomly generated salt) | | returnVariable | expression, variable | name of the variable to be assigned to the return value | ```actionscript cryptDES = cryptPassword("password", "DES") ``` ### hashBytes Calculate secure hash for a byte array. | Property | Value | Description | | --- | --- | --- | | data* | expression, variable | data to hash | | algorithm* | choice (MD5, SHA-1, SHA-256, SHA-384, SHA-512), text, expression, variable | secure hash algorithm | | returnType | choice (ASCII-HEX, BASE64, BYTEARRAY), text, expression, variable | return type (default: ASCII-HEX) | | returnVariable | expression, variable | name of the variable to be assigned to the return value | ```actionscript md5bytehash = hashBytes(new java.lang.String("password") .getBytes("UTF-8"), "MD5") ``` ### hashString Calculate secure hash for a string. | Property | Value | Description | | --- | --- | --- | | data* | text, expression, variable | data to encode | | algorithm* | choice (MD5, SHA-1, SHA-256, SHA-384, SHA-512), text, expression, variable | secure hash algorithm | | charset | text, expression, variable | character set encoding for converting characters to bytes(default: UTF-8) | | returnType | choice (ASCII-HEX, BASE64, BYTEARRAY), text, expression, variable | return type (default: ASCII-HEX) | | returnVariable | expression, variable | name of the variable to be assigned to the return value | ```actionscript sha1stringhash = hashString("password","SHA-1", "UTF-8") ``` ### macBytes Calculate Message Authentication Code (MAC) for a byte array. | Property | Value | Description | | --- | --- | --- | | key* | text, expression, variable | authentication key | | data* | expression, variable | data to hash | | algorithm* | choice (HmacMD5, HmacSHA1, HmacSHA256, HmacSHA384, HmacSHA512), text, expression, variable | MAC algorithm | | returnType | choice (ASCII-HEX, BASE64, BYTEARRAY), text, expression, variable | return type (default: ASCII-HEX) | | returnVariable | expression, variable | name of the variable to be assigned to the return value | ```actionscript hmacSHA1Bytes = macBytes(mySecretKey, new java.lang.String ("Message to be signed").getBytes("UTF-8"), "HmacSHA1", "ASCII-HEX") ``` ### macString Calculate Message Authentication Code (MAC) for a string. | Property | Value | Description | | --- | --- | --- | | key* | text, expression, variable | authentication key | | data* | text, expression, variable | data to encode | | algorithm* | choice (HmacMD5, HmacSHA1, HmacSHA256, HmacSHA384, HmacSHA512), text, expression, variable | MAC algorithm | | charset | text, expression, variable | character set encoding for converting characters to bytes(default: UTF-8) | | returnType | choice (ASCII-HEX, BASE64, BYTEARRAY), text, expression, variable | return type (default: ASCII-HEX) | | returnVariable | expression, variable | name of the variable to be assigned to the return value | ```actionscript hmacSHA1String = macString(mySecretKey, "Message to be signed", "HmacSHA1", "UTF-8", "BASE64") ```