RapidIdentity Product Guide

Crypto Actions

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

Example

cryptDES = cryptPassword("password", "DES")

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

Example

md5bytehash = hashBytes(new java.lang.String("password")
    .getBytes("UTF-8"), "MD5")

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

Example

sha1stringhash = hashString("password","SHA-1", "UTF-8") 

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

Example

hmacSHA1Bytes = macBytes(mySecretKey, new java.lang.String
    ("Message to be signed").getBytes("UTF-8"), "HmacSHA1", "ASCII-HEX") 

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

Example

hmacSHA1String = macString(mySecretKey, "Message to be signed", 
    "HmacSHA1", "UTF-8", "BASE64")