# Update Password Encryption Method

**URL:** https://meta.discourse.org/t/update-password-encryption-method/316314
**Category:** Development
**Created:** [July 15, 2024, 11:54am UTC](https://meta.discourse.org/t/update-password-encryption-method/316314 "2024-07-15T11:54:35Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![gambhir-makwana](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gambhir-makwana/32/494314_2.png) [@gambhir-makwana](https://meta.discourse.org/u/gambhir-makwana)
#### Post date: [July 15, 2024, 11:54am UTC](https://meta.discourse.org/t/update-password-encryption-method/316314/1 "2024-07-15T11:54:35Z")

</div>

Hello [@everyone](https://meta.discourse.org/groups/everyone)

I need to implement custom code-level and database-level changes in my Discourse Rails application to meet my specific requirements.

Update password encryption method. Currently, Discourse uses “PBKDF2” for password encryption.  
As per my requirement, I need to switch to “MD5” instead of “PBKDF2”.

I have setup code in my local environment and also, deployed discourse the production environment using Docker.

When I update the local code based on my requirement then I need to redeploy my updated code in the production environment but currently, I have set the production environment discourse official docker file so I need to generate a new docker file how I can create a new docker file and how to access PostgreSQL database discourse application production environment

---

<div class="post-metadata">

### Author: ![selase](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/selase/32/270909_2.png) [@selase](https://meta.discourse.org/u/selase)
#### Post date: [July 15, 2024, 1:03pm UTC](https://meta.discourse.org/t/update-password-encryption-method/316314/2 "2024-07-15T13:03:15Z")

</div>

> [@gambhir-makwana](#):
>
> Update password encryption method. Currently, Discourse uses “PBKDF2” for password encryption.  
> As per my requirement, I need to switch to “MD5” instead of “PBKDF2”.

This appears to be a significant security downgrade. MD5 is unsuitable for password hashing. Not only would this change affect a critical part of Discourse, but you would also need to maintain it for all future releases.

Perhaps we can suggest a better approach if you could explain what you’re trying to achieve.

Regarding customizing Discourse, please take a look at [Developing Discourse Plugins - Part 1 - Create a basic plugin](https://meta.discourse.org/t/developing-discourse-plugins-part-1-create-a-basic-plugin/30515). The plugin system allows you to safely extend core features.

---

<div class="post-metadata">

### Author: ![gambhir-makwana](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gambhir-makwana/32/494314_2.png) [@gambhir-makwana](https://meta.discourse.org/u/gambhir-makwana)
#### Post date: [July 15, 2024, 1:18pm UTC](https://meta.discourse.org/t/update-password-encryption-method/316314/3 "2024-07-15T13:18:50Z")

</div>

I have a created new API’s and I need to redeployed in my production code How it possible to deployed in production docker

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 15, 2024, 4:52pm UTC](https://meta.discourse.org/t/update-password-encryption-method/316314/4 "2024-07-15T16:52:10Z")

</div>

You want to make your changes in a plugin. If you want to fork Discourse and try to maintain that separately you’ll be very, very, sorry, if history is any indicator.

What problem are you trying to solve with passwords stored as an MD5 hashh? As suggested already, the whole internet seems to agree that MD5 is not encryption and not suitable for storing passwords.

---

<div class="post-metadata">

### Author: ![supermathie](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/supermathie/32/507518_2.png) [@supermathie](https://meta.discourse.org/u/supermathie)
#### Post date: [July 15, 2024, 5:02pm UTC](https://meta.discourse.org/t/update-password-encryption-method/316314/5 "2024-07-15T17:02:03Z")

</div>

> [@gambhir-makwana](#):
>
> Discourse uses “PBKDF2” for password encryption.

Clarification: as Jay [notes](https://meta.discourse.org/t/update-password-encryption-method/316314/4), neither [MD5](https://www.okta.com/identity-101/md5/) nor [PBKDF2](https://en.wikipedia.org/wiki/PBKDF2) are encryption functions.

They are both hashing functions. Discourse does not store passwords.

> [@selase](#):
>
> This appears to be a significant security downgrade. MD5 is unsuitable for password hashing.

Spot on. Even if you don’t believe us, we’re [not the only ones saying this](https://www.okta.com/identity-101/md5/).

**What problem are you trying to solve?**

---

<div class="post-metadata">

### Author: ![gambhir-makwana](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/gambhir-makwana/32/494314_2.png) [@gambhir-makwana](https://meta.discourse.org/u/gambhir-makwana)
#### Post date: [July 16, 2024, 6:22am UTC](https://meta.discourse.org/t/update-password-encryption-method/316314/6 "2024-07-16T06:22:33Z")

</div>

Need help to find a solution. I need to change an encryption method in ROR (Discourse). Currently, I am using MD5 encryption. I made changes in the code level in my local environment. How can I reflect those changes in the live server without the help of Docker?

Currently, the production environment is set up using Docker configuration

Here is the link that was followed to set up the production environment.  
URL: [discourse/docs/INSTALL-cloud.md at main · discourse/discourse · GitHub](https://github.com/discourse/discourse/blob/main/docs/INSTALL-cloud.md#5-install-)

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [July 16, 2024, 12:31pm UTC](https://meta.discourse.org/t/update-password-encryption-method/316314/7 "2024-07-16T12:31:28Z")

</div>

You still haven’t said what problem you’re trying to solve. Can you say more about what MD 5 is solving?

You still need to implement whatever changes you make on a plugin. Have you started to learn how plugins work?

But I bet what you really want is to have discourse authenticate against your existing app, in case you just need to implement discourse\_connect and discourse won’t need to know about your choices in password storage.
