# encrypt_cryptopan

Encrypts an IP address via Crypto-PAn.

```tql
encrypt_cryptopan(address:ip, [seed=string])
```

## Description

The `encrypt_cryptopan` function encrypts the IP `address` using the [Crypto-PAn](https://en.wikipedia.org/wiki/Crypto-PAn) algorithm.

### `address: ip`

The IP address to encrypt.

### `seed = string (optional)`

A 64-character seed that describes a hexadecimal value. When the seed is shorter than 64 characters, the function appends zeros to match the size; when it is longer, it truncates the seed.

## Examples

### Encrypt IP address fields

```tql
let $seed = "deadbeef"
from {
  src: encrypt_cryptopan(114.13.11.35, seed=$seed),
  dst: encrypt_cryptopan(114.56.11.200, seed=$seed),
}
```

```tql
{
  src: 117.179.11.60,
  dst: 117.135.244.180,
}
```

## See Also

* [`community_id`](https://preview.docs.tenzir.com/407/reference/functions/community_id.md)
* [`decrypt_cryptopan`](https://preview.docs.tenzir.com/407/reference/functions/decrypt_cryptopan.md)
* [Manipulate strings](https://preview.docs.tenzir.com/407/guides/transformation/manipulate-strings.md)
* [Mask sensitive data](https://preview.docs.tenzir.com/407/guides/transformation/mask-sensitive-data.md)