# PDF encryption API

Source: https://pdfluent.com/pdf-api/protect/

A PDF in. A locked PDF out.

A password with AES-256 encryption, and the same API removes it when you supply it.

[Try the API for $1](https://console.pdfluent.com/signup)[Encrypt reference](https://pdfluent.com/docs/api/reference/pdf-encrypt/)

USD 0.01

per file

Up to 50 pages

AES-256

encryption

User and owner password

Decrypt

with the password

Same API

Price

USD 0.01

per document, up to 50 pages

[All PDF API prices](https://pdfluent.com/pdf-api/pricing/)

Code

## One request.

```
curl -sS -f -X POST "$PDFLUENT_API_URL/v1/pdf/encrypt" \  -H "x-api-key: $PDFLUENT_API_KEY" \  -F file=@report.pdf \  -F 'options={"user_password":"secret"}' \  -o locked.pdf
```

Questions

## Questions

### How do I password protect a PDF with the API? +

Send the file and the password in one POST request to the encrypt endpoint. The response is the protected PDF.

### Can I remove a password? +

Yes, if you supply the correct password. The decrypt endpoint returns an unprotected PDF.

### Is the password stored? +

The privacy page states what the hosted API keeps and for how long.

## Try it for USD 1.

[Try the API for $1](https://console.pdfluent.com/signup)[Quickstart](https://pdfluent.com/docs/api/quickstart/)

- [Available on Microsoft Marketplace](https://marketplace.microsoft.com/en-us/product/pdfluent.pdfluent-pdf-api)

More jobs: [Convert PDF](https://pdfluent.com/pdf-api/convert/)[Fill forms](https://pdfluent.com/pdf-api/forms/)[Merge PDF](https://pdfluent.com/pdf-api/merge/)[Split PDF](https://pdfluent.com/pdf-api/split/)[Compress PDF](https://pdfluent.com/pdf-api/compress/)[Watermark](https://pdfluent.com/pdf-api/watermark/)[Redact](https://pdfluent.com/pdf-api/redact/)[Sign](https://pdfluent.com/pdf-api/sign/)[PDF/A and e-invoice](https://pdfluent.com/pdf-api/pdfa-einvoice/)[OCR](https://pdfluent.com/pdf-api/ocr/)

[All PDF API use cases](https://pdfluent.com/pdf-api/) · [Pricing](https://pdfluent.com/pdf-api/pricing/) · [Compared](https://pdfluent.com/pdf-api/compare/) · [Free editor](https://pdfluent.com/guides/password-protect-a-pdf/) · [SDK](https://pdfluent.com/how-to/security/)
