# How to Decrypt SHA1 Passwords

**URL:** <https://forum.inductiveautomation.com/t/how-to-decrypt-sha1-passwords/78700>\
**Category:** Ignition\
**Tags:** ignition81\
**Created:** [September 4, 2023, 12:31am UTC](https://forum.inductiveautomation.com/t/how-to-decrypt-sha1-passwords/78700 "2023-09-04T00:31:49Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![yiotis](https://avatars.discourse-cdn.com/v4/letter/y/e99b99/32.png) [@yiotis](https://forum.inductiveautomation.com/u/yiotis)\
**Post date:** [September 4, 2023, 2:55am UTC](https://forum.inductiveautomation.com/t/how-to-decrypt-sha1-passwords/78700/3 "2023-09-04T02:55:39Z")

</div>

Kevin Thanks. I learned something new. Maybe you can steer me the right direction. I am using SQL to store my usernames and passwords. As of now they are plain text. In ignition when someone signs-in by providing a username/password, I run a query against the user entered credentials and the database credentials and if valid, I pass them to the SwitchUser command for ignition to actually perform the login. I don't like that the password is plain text thus me trying to encrypt it or "hide" it. I tried 2 different methods. Method #1 was using SHA1 and Method #2 using AES encryption that I discovered in the post below. Here's my problem. Both methods "hide" the password, but Ignitions SwitchUser has no way to "Decrypt" it. It simply treats it as a plain text password, and if you were to pass to SwitchUser the hash or the actual encrypted text, it will allow you to login as it simply sees it as the password. So my problem is; how do you properly encrypt and decrypt a password in ignition. Hopefully I am making sense.

> [@AES Encryption using Scripting](https://forum.inductiveautomation.com/t/aes-encryption-using-scripting/24554):
>
> Hi, I need to encrypt a string using AES 128. Is there a way to do it within Ignition? I tried with PyCrypto library, it didn’t work. Thanks,

---

_[View the full topic](https://forum.inductiveautomation.com/t/how-to-decrypt-sha1-passwords/78700)._
