---
schema_version: "1"
id: fd1611ae99d171df8cd68322d92a00a2027049e1bb327e2aec3527a948c2cc8b
title: Crypto Annotations (dw::Crypto)
collection: mulesoft
version: current
locale: en-us
portal_url: https://docs.salesforce.com/mulesoft/current/en-us/dataweave/latest/dw-crypto-annotations.md
canonical_url: https://docs.mulesoft.com/dataweave/latest/dw-crypto-annotations
source_site: docs.mulesoft.com
content_type: documentation
content_hash: b58ddbb97663fb87ed046a61102e5e87e52a108c92e9a6bc6ac97a538ae59ab0
description: MuleSoft Documentation Site
release: "2.13"
latest: true
---
---
product: DataWeave
version: 2.13
is-latest-version: true
---

# 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></td></tr></tbody></table>

## Error

When an insecure algorithm is detected, DataWeave produces this error:

Cryptographic violation: Forbidden use of algorithm <algorithm> in <module>.

### Example

This function declares an algorithm parameter as a cryptographic sink.

#### Source

```DataWeave
fun hashWith(content: Binary, @CryptographicSink algorithm: String = "SHA-1"): Binary = native("system::HashFunctionValue")
```

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.

```DataWeave
hashWith("data" as Binary, "MD5")
```
