﻿# encrypted

> Recognize Dotenvx ciphertext prefixes

[Rust primitives](/docs/sdk/rust/primitives/)

```rust
dotenvx_primitives::encrypted
```

## Usage

Recognizes versioned DOTENV-CIPHERTEXT- values and the supported encrypted: format. This checks the prefix rather than cryptographic validity.

```rust
let pair = dotenvx_primitives::keypair(None)?;
let ciphertext = dotenvx_primitives::encrypt(&pair.public_key, "World")?;
assert!(dotenvx_primitives::encrypted(&ciphertext));
assert!(!dotenvx_primitives::encrypted("World"));
```
