# ENCRYPTION.VERIFY

> Check that an encrypted file on the server decrypts completely and has not been altered.

URL: https://docs.hotkv.com/commands/encryption-verify/

```
ENCRYPTION.VERIFY file
```

- Group: Encryption
- Complexity: O(N) where N is the size of the file
- HotKV Cloud: Scale plan
- On-Premise: requires the encryption-at-rest license feature

`ENCRYPTION.VERIFY` reads an encrypted file on the server, such as a
snapshot, and checks that it decrypts completely and that nothing in it was
changed or cut off. No plaintext is written anywhere. Use it to check a
backup before you rely on it.

The file is checked with the key in use now. After
[ENCRYPTION.ROTATE](https://docs.hotkv.com/commands/encryption-rotate/index.md), a snapshot written with
the old key verifies as `0`.

## Return value

| Case | RESP2 | RESP3 |
| --- | --- | --- |
| The file is intact | Integer `1` | Integer `1` |
| Damaged, altered, not encrypted, written with another key, or not readable | Integer `0` | Integer `0` |

Without a license that includes `encryption-at-rest`, the reply is
`NOLICENSE encryption-at-rest requires a HotKV license. Contact sales@hotkv.com`.

## Examples

```
127.0.0.1:6379> ENCRYPTION.VERIFY /var/lib/hotkv/dump.rdb
(integer) 1
127.0.0.1:6379> ENCRYPTION.VERIFY /var/lib/hotkv/dump-corrupted.rdb
(integer) 0
```

## Compatibility

HotKV-only command.

## See also

[ENCRYPTION.INFO](https://docs.hotkv.com/commands/encryption-info/index.md),
[ENCRYPTION.ROTATE](https://docs.hotkv.com/commands/encryption-rotate/index.md)