# Password encryption in DB

**URL:** <https://forum.inductiveautomation.com/t/password-encryption-in-db/63312>\
**Category:** Ignition\
**Created:** [August 23, 2022, 6:36am UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312 "2022-08-23T06:36:04Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [August 23, 2022, 6:36am UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/1 "2022-08-23T06:36:04Z")

</div>

The password encryption in DB doesn't match MD5 or SHA1 or PASSWORD either in Automatic mode or Manual mode! How to know the encryption used?

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 23, 2022, 8:11am UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/2 "2022-08-23T08:11:44Z")

</div>

What DB?

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [August 23, 2022, 8:17am UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/3 "2022-08-23T08:17:43Z")

</div>

MySql? In Ignition.

---

<div class="post-metadata">

**Author:** ![Transistor](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/transistor/32/3380_2.png) [@Transistor](https://forum.inductiveautomation.com/u/Transistor)\
**Post date:** [August 23, 2022, 8:29am UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/4 "2022-08-23T08:29:00Z")

</div>

No, is the DB one you created yourself or one created by Ignition?  
What is writing to the table?  
If it is a script then please show the script.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [August 23, 2022, 8:33am UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/5 "2022-08-23T08:33:15Z")

</div>

Created by Ignition (automatic mode). Then I want to use the same encryption approach for my manual creation of passwords.

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 23, 2022, 11:32am UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/6 "2022-08-23T11:32:23Z")

</div>

always alteast salt and hash stored passowrds

---

<div class="post-metadata">

**Author:** ![Kevin.Herron](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/kevin.herron/32/7259_2.png) [@Kevin.Herron](https://forum.inductiveautomation.com/u/Kevin.Herron)\
**Post date:** [August 23, 2022, 1:07pm UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/7 "2022-08-23T13:07:38Z")

</div>

The DB automatic user profile is pretty outdated and just using sha1, no salt. You can do better unless you’re trying to be compatible for some reason.

The internal user source profile uses sha256 with a salt.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [August 23, 2022, 1:49pm UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/8 "2022-08-23T13:49:44Z")

</div>

I am trying to decipher the encryption used for an encrypted and known password from its encrypted value. Is it possible? If salt is used then the same password may get encrypted differently, I guess. But if it's the same for multiple instances of the same password I guess it may be possible? I have no clue how to decipher the algorithm used!

---

<div class="post-metadata">

**Author:** ![pturmel](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pturmel/32/3295_2.png) [@pturmel](https://forum.inductiveautomation.com/u/pturmel)\
**Post date:** [August 23, 2022, 1:51pm UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/9 "2022-08-23T13:51:47Z")

</div>

Are you trying to _ **recover** _ the password? That ain’t happening. They _aren’t_ encrypted. They are _ **hashed** _. Non-reversible.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [August 23, 2022, 1:57pm UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/10 "2022-08-23T13:57:04Z")

</div>

Oh, that's an important information. Thanks a lot!  
Basically I am trying to see what encryption/encoding/hashing algorithm I can specify in my authentication query such as "....**AND password = MD5(?)**" for an existing user table!

---

<div class="post-metadata">

**Author:** ![victordcq](https://avatars.discourse-cdn.com/v4/letter/v/f6c823/32.png) [@victordcq](https://forum.inductiveautomation.com/u/victordcq)\
**Post date:** [August 23, 2022, 3:00pm UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/11 "2022-08-23T15:00:29Z")

</div>

uf yikes yeah it should be impossible to reverse… else that would be a mayor security flaw, DO NOT save passowords like that.

---

<div class="post-metadata">

**Author:** ![PRAMANJ](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/pramanj/32/66935_2.png) [@PRAMANJ](https://forum.inductiveautomation.com/u/PRAMANJ)\
**Post date:** [August 23, 2022, 3:01pm UTC](https://forum.inductiveautomation.com/t/password-encryption-in-db/63312/12 "2022-08-23T15:01:37Z")

</div>

Basically, I am trying to see what encryption/encoding/hashing algorithm I can specify in my authentication query such as “…**AND password = MD5(?)** ” for an existing user table having 'password' stored as string W6ph5Mm5Pz8GgiULbPgzG37mj9g=
