ltm rule command CRYPTO hashΒΆ

iRule(1)		      BIG-IP TMSH Manual		      iRule(1)



CRYPTO::hash
       Generates a hash on a piece of data.

SYNOPSIS
       CRYPTO::hash (('-alg' ('md5' | 'ripemd160' | 'sha1' | 'sha224' |
       'sha256' | 'sha384'
			  | 'sha512'))
		('-ctx' CONTEXT)
		('-final')
	       )#
	       (CRYPTO_DATA)?

DESCRIPTION
       This iRules command generates a hash on a piece of data

       CRYPTO::hash [-alg <>] [-ctx <> [-final]] []

	    * Generates a hash on a piece of data

       Algorithm List

	    * md5
	    * ripemd160
	    * sha1
	    * sha224
	    * sha256
	    * sha384
	    * sha512

RETURN VALUE
VALID DURING
EXAMPLES
	when HTTP_REQUEST {
	if {[class match [b64encode [CRYPTO::hash -alg sha384 [HTTP::host][HTTP::path]]] equals HASH ]} {
	    log local0. " this FQDN + PATH is mathing - [HTTP::host][HTTP::path]"
	}
	}

	This example shows how CRYPTO::hash command can be used by hashing the
	FQDN and PATH of a URI, and checking if this matches a DATAGROUP
	   (called HASH) composed of externally hashed URLs. The hashed URLs in
	the DATAGROUP, are given by an external company, and hashed to avoid
	reverse engineering of the URL DB. The goal of the iRule is to check if
	there is a match in this HASHED URL DB.

HINTS
SEE ALSO
CHANGE LOG
       @BIGIP-11.1.0 --First introduced the command.



BIG-IP				  2017-01-31			      iRule(1)