# Decrypt files while indexing

**URL:** <https://discuss.elastic.co/t/decrypt-files-while-indexing/78742>\
**Category:** Elasticsearch\
**Created:** [March 15, 2017, 4:25pm UTC](https://discuss.elastic.co/t/decrypt-files-while-indexing/78742 "2017-03-15T16:25:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ESCoder](https://avatars.discourse-cdn.com/v4/letter/e/9e8a1a/32.png) [@ESCoder](https://discuss.elastic.co/u/ESCoder)\
**Post date:** [March 15, 2017, 4:25pm UTC](https://discuss.elastic.co/t/decrypt-files-while-indexing/78742/1 "2017-03-15T16:25:15Z")

</div>

hi,  
i was wondering if you guys had any suggestions on the scenario below:  
if the files we are trying to index are encrypted, we do not want to decrypt the files and feed it to the indexer. Can we add the decryption process in the ingest pipeline so that the decryption is done right before the indexing?

Thanks

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 15, 2017, 7:29pm UTC](https://discuss.elastic.co/t/decrypt-files-while-indexing/78742/2 "2017-03-15T19:29:03Z")

</div>

You can create a JSON which contains one field with the BASE64 encoded content.

Then write an ingest plugin which decodes that field, decrypt the content.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [April 12, 2017, 7:29pm UTC](https://discuss.elastic.co/t/decrypt-files-while-indexing/78742/3 "2017-04-12T19:29:07Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
