Description
An OpenInsight wrapper for MD3 and SHA1 encryption. The RTI_Crypto provides for the ability to create encrypted values for authentication purposes. The function is a one-way hash and cannot be unencrytped via the function.
Syntax
ans = RTI_Crypto ( method, param1, param2, param3 )
Parameters
The function has the following parameters:
Parameter | Description |
---|---|
method | The methods are: HEX_MD5 B64_MD5 STR_MD5 HEX_HMAC_MD5 B64_HMAC_MD5 STR_HMAC_MD5 HEX_SHA1 B64_SHA1 STR_SHA1 ANY_SHA1 HEX_HMAC_SHA1 B64_HMAC_SHA1 ANY_HMAC_SHA1 STR_HMAC_SHA1 |
param1 | Parameter value is based on the cryptographic method used. |
param2 | Parameter value is based on the cryptographic method used. |
param3 | Parameter value is based on the cryptographic method used. |
Usage
retVal = RTI_Crypto( "HEX_MD5", string ) retVal = RTI_Crypto( "B64_MD5", string ) retVal = RTI_Crypto( "STR_MD5", string )
retVal = RTI_Crypto( "HEX_HMAC_MD5", key, data ) retVal = RTI_Crypto( "B64_HMAC_MD5", key, data ) retVal = RTI_Crypto( "STR_HMAC_MD5", key, data )
retVal = RTI_Crypto( "HEX_SHA1", string ) retVal = RTI_Crypto( "B64_SHA1", string ) retVal = RTI_Crypto( "STR_SHA1", string ) retVal = RTI_Crypto( "ANY_SHA1", string, e )
retVal = RTI_Crypto( "HEX_HMAC_SHA1", key, data ) retVal = RTI_Crypto( "B64_HMAC_SHA1", key, data ) retVal = RTI_Crypto( "ANY_HMAC_SHA1", key, data, e ) retVal = RTI_Crypto( "STR_HMAC_SHA1", key, data )
Returns
An encrypted value.
Remarks
This function implements cryptographic functions from http://pajhome.org.uk/crypt/md5/index.html. Review http://pajhome.org.uk/crypt/md5/index.html to see code and examples of usage. The scripts are implemented verbatim in OpenInsight without change and without need to access external webserver.
Example
declare function RTI_Crypto crytpo = RTI_Crypto( "HEX_MD5", "ABC" ) * The crypto variable will contain: 902fbdd2b1df0c4f70b4a5d23525e932