---
schema_version: "1"
id: 8f4a7fc1a3a9480f0a5f8b0008d461248a3ad937e9be22143b702db2303d9030
title: Crypto Annotations (dw::Crypto)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/2.12/dw-crypto-annotations.md
canonical_url: https://docs.mulesoft.com/dataweave/2.12/dw-crypto-annotations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: 5ae84925f046c84de74a1cd56e5fdefd16968b7b80f99d76775e0fd16bad18c9
description: MuleSoft Documentation Site
release: "2.12"
latest: false
---
---
product: DataWeave
version: 2.12
---

# Crypto Annotations (dw::Crypto)

> For the full documentation index, see: https://docs.mulesoft.com/llms.txt

Parameters annotated with `@CryptographicSink` are subject to taint analysis during type checking.
When a literal algorithm value is passed to a parameter marked with this annotation, the type
checker validates whether the algorithm is permitted. If the algorithm matches a forbidden or
insecure algorithm (such as MD5 or SHA-1 in FIPS-compliant environments), a compilation error is
raised.

This annotation can only be applied to function parameters.

## Parameters

<table><colgroup><col> <col> <col></colgroup><thead><tr><th>Annotation</th><th>Definition</th><th>Description</th></tr></thead><tbody><tr><td><p>CryptographicSink</p></td><td><div><div><p><code>@CryptographicSink()</code></p></div></div></td><td><div><div><p>Marks a function parameter as a cryptographic algorithm sink for security validation.</p></div><div><h2 id="error"><a href="#error"></a>Error</h2><div><div><p>When an insecure algorithm is detected, DataWeave produces this error:</p></div><div><div><pre>Cryptographic violation: Forbidden use of algorithm &lt;algorithm&gt; in &lt;module&gt;.</pre></div></div><div><h3 id="example"><a href="#example"></a>Example</h3><div><p>This function declares an algorithm parameter as a cryptographic sink.</p></div><div><h4 id="source"><a href="#source"></a>Source</h4><div><div><pre><code data-lang="DataWeave">fun hashWith(content: Binary, @CryptographicSink algorithm: String = "SHA-1"): Binary = native("system::HashFunctionValue")</code></pre></div></div><div><p>When called with a forbidden algorithm in a security-restricted environment, DataWeave produces this error. For example, this error occurs when MD5 is configured as a forbidden algorithm.</p></div><div><div><pre><code data-lang="DataWeave">hashWith("data" as Binary, "MD5")</code></pre></div></div></div></div></div></div></div></td></tr></tbody></table>
