# SHA256 or MD5 in Logstash cipher filter plugin algorithm

**URL:** <https://discuss.elastic.co/t/sha256-or-md5-in-logstash-cipher-filter-plugin-algorithm/287328>\
**Category:** Logstash\
**Created:** [October 21, 2021, 2:25pm UTC](https://discuss.elastic.co/t/sha256-or-md5-in-logstash-cipher-filter-plugin-algorithm/287328 "2021-10-21T14:25:16Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Askia\_Mohamed\_Kadri](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/askia_mohamed_kadri/32/134665_2.png) [@Askia\_Mohamed\_Kadri](https://discuss.elastic.co/u/Askia_Mohamed_Kadri)\
**Post date:** [October 21, 2021, 2:25pm UTC](https://discuss.elastic.co/t/sha256-or-md5-in-logstash-cipher-filter-plugin-algorithm/287328/1 "2021-10-21T14:25:16Z")

</div>

Hi!

I'm using cipher filter plugin in my Logstash configuration and the only example I saw until now for the algorithm is aes-256-cbc and I'd like to use md5 or sha256. How is it possible?

Here is my configuration below:

```auto
cipher {
				algorithm => "aes-256-cbc"
				cipher_padding => 1
				iv_random_length => 16
 
				key => "KEY_OF_32_CHAR"
				key_size => 32
 
				mode => "encrypt"
				source => "message"
				target => "message_crypted"
				base64 => true
				max_cipher_reuse => 1
			}

```

---

<div class="post-metadata">

**Author:** ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)\
**Post date:** [October 21, 2021, 4:13pm UTC](https://discuss.elastic.co/t/sha256-or-md5-in-logstash-cipher-filter-plugin-algorithm/287328/2 "2021-10-21T16:13:27Z")

</div>

The [documentation](https://www.elastic.co/guide/en/logstash/current/plugins-filters-cipher.html#plugins-filters-cipher-algorithm) tells you how to list the available ciphers.

Do not use MD5, it was known to be flawed 30 years ago, and was clearly broken 20 years ago. SHA-1 was deprecated in 2005, do not use that either. It is time to move away from SHA-256 but right now it is still secure.

---

<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:** [November 18, 2021, 4:14pm UTC](https://discuss.elastic.co/t/sha256-or-md5-in-logstash-cipher-filter-plugin-algorithm/287328/3 "2021-11-18T16:14:14Z")

</div>

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