Skip to main content

CryptographicHashContent

Description

Calculates a cryptographic hash value for the flowfile content using the given algorithm and writes it to an output attribute. Please refer to https://csrc.nist.gov/Projects/Hash-Functions/NIST-Policy-on-Hash-Functions for help to decide which algorithm to use.

Tags

blake2, content, cryptography, hash, md5, sha

Properties

In the list below required Properties are shown with an asterisk (*). Other properties are considered optional. The table also indicates any default values, and whether a property supports the NiFi Expression Language.

Display NameAPI NameDefault ValueAllowable ValuesDescription
Fail if the content is empty *fail_when_emptyfalse
  • true
  • false
Route to failure if the content is empty. While hashing an empty value is valid, some flows may want to detect empty input.
Hash Algorithm *hash_algorithmSHA-256
  • MD2
  • MD5
  • SHA-1
  • SHA-224
  • SHA-256
  • SHA-384
  • SHA-512
  • SHA-512/224
  • SHA-512/256
  • SHA3-224
  • SHA3-256
  • SHA3-384
  • SHA3-512
  • BLAKE2-160
  • BLAKE2-256
  • BLAKE2-384
  • BLAKE2-512
The hash algorithm to use. Note that not all of the algorithms available are recommended for use (some are provided for legacy compatibility). There are many things to consider when picking an algorithm; it is recommended to use the most secure algorithm possible.

Dynamic Properties

This component does not support dynamic properties.

Relationships

NameDescription
failureUsed for flowfiles that have no content if the 'fail on empty' setting is enabled
successUsed for flowfiles that have a hash value added

Reads Attributes

This processor does not read attributes.

Writes Attributes

NameDescription
content_<algorithm>This processor adds an attribute whose value is the result of hashing the flowfile content. The name of this attribute is specified by the value of the algorithm, e.g. 'content_SHA-256'.

State Management

This component does not store state.

Restricted

This component is not restricted.

Input Requirement

This component requires an incoming relationship.

System Resource Considerations

This component does not specify system resource considerations.

See Also