# Password Encryption

**URL:** <https://www.dynamicsuser.net/t/password-encryption/5201>\
**Category:** Developers Forum\
**Created:** [July 24, 2001, 2:52pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201 "2001-07-24T14:52:25Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![vshal](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@vshal](https://www.dynamicsuser.net/u/vshal)\
**Post date:** [July 24, 2001, 2:52pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/1 "2001-07-24T14:52:25Z")

</div>

Hello People…!! I have a problem here dont know whether to call it small ro big. Anyways, here it is… I have to accept the USERID and PASSOWORD of a user for Authorising a particular transaction, till here its ok working cool. After accepting the userid and password, I need to check whether the USERID exists in the USER table and the entered password matchs the USER table Password. As we all know that the password field is encrypted I need to decrypt it to check it with the accepted password. Does anyone here knows how to Decrypt the Password. Eg. UserTable.Get(EnteredUserID); if Usertable.Password = EnteredPassword then Authorize := true; regards and thanks…

---

<div class="post-metadata">

**Author:** ![SNielsen](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@SNielsen](https://www.dynamicsuser.net/u/SNielsen)\
**Post date:** [July 24, 2001, 3:10pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/2 "2001-07-24T15:10:21Z")

</div>

Vishal, use a different approach to this. Instead de-crypting the password, try and en-crypt the password the user enters. Use table 2000000002 User as a temporary table, validate the userid and password, and do the compare on this record to the original entry. **_Soren Nielsen_, moderator Integration/Developer NOLUG**

---

<div class="post-metadata">

**Author:** ![SNielsen](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@SNielsen](https://www.dynamicsuser.net/u/SNielsen)\
**Post date:** [July 24, 2001, 3:12pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/3 "2001-07-24T15:12:35Z")

</div>

Sorry, let me give you some code:

```auto

User.GET(USERID);
tempUser.VALIDATE("User ID",enteredUserID);
tempUser.VALIDATE(Password,enteredPassword);
IF tempUser.Password <> User.Password THEN
  ERROR('Wrong password');

```

**_Soren Nielsen_, moderator Integration/Developer NOLUG** Edited by - SNielsen on 2001 Jul 24 16:13:30

---

<div class="post-metadata">

**Author:** ![DarrenBezzant](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@DarrenBezzant](https://www.dynamicsuser.net/u/DarrenBezzant)\
**Post date:** [July 24, 2001, 3:16pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/4 "2001-07-24T15:16:17Z")

</div>

This is the logic that I used for something like that, hopefully it will be useful to you NOTE: Both User and TempUser are Record Variables pointing to the User Table. IF User.GET(UID) THEN BEGIN TempUser.“User ID” := UID; TempUser.Password:= Pwd; TempUser.VALIDATE(Password); IF TempUser.Password \<\> User.Password THEN ValidationStatus := 99 //Password does not match ELSE ValidationStatus := 1 // PASS!!! END ELSE ValidationStatus := 55; // User Not Found EXIT(ValidationStatus) Darren Bezzant Development Specialist [dbezzant@csbsystems.com](mailto:dbezzant@csbsystems.com) CSB Systems 1560 - 333 11th Avenue SW Calgary, Alberta T2R 1L9 Tel: (403) 233-2955 Fax: (403) 233-2957

---

<div class="post-metadata">

**Author:** ![DarrenBezzant](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@DarrenBezzant](https://www.dynamicsuser.net/u/DarrenBezzant)\
**Post date:** [July 24, 2001, 3:17pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/5 "2001-07-24T15:17:42Z")

</div>

Looks Like Soren beat me to the punch. Thats what i get for going for coffee in the middle 🙂

---

<div class="post-metadata">

**Author:** ![vshal](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@vshal](https://www.dynamicsuser.net/u/vshal)\
**Post date:** [July 24, 2001, 3:26pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/6 "2001-07-24T15:26:18Z")

</div>

Hi Soren,

> quote:
> 
> * * *
> 
> User.GET(USERID);tempUser.VALIDATE (UserID,enteredUserID);tempUser.VALIDATE(Password,enteredPassword);IF tempUser.Password \<\> User.Password THEN ERROR(‘Wrong password’);
> 
> * * *

Thanks so much for the solution, i already tried this approach, but the problem still exists, after encrypting the EnteredPassord value if you message both the values i.e. User.Get(EnteredUserID); message(‘%1 - %2’,Usertable.Password,enteredpassword); they dont appear to be the same so it wont match. Regards Vishal

---

<div class="post-metadata">

**Author:** ![DarrenBezzant](https://avatars.discourse-cdn.com/v4/letter/d/838e76/32.png) [@DarrenBezzant](https://www.dynamicsuser.net/u/DarrenBezzant)\
**Post date:** [July 24, 2001, 3:41pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/7 "2001-07-24T15:41:57Z")

</div>

Not sure why they would not be matching, I just tried it with my setup, it worked fine. Could you supply the code that you are using and maybe something will show up. Cheers Darren Bezzant Development Specialist [dbezzant@csbsystems.com](mailto:dbezzant@csbsystems.com) CSB Systems 1560 - 333 11th Avenue SW Calgary, Alberta T2R 1L9 Tel: (403) 233-2955 Fax: (403) 233-2957

---

<div class="post-metadata">

**Author:** ![SNielsen](https://avatars.discourse-cdn.com/v4/letter/s/9de0a6/32.png) [@SNielsen](https://www.dynamicsuser.net/u/SNielsen)\
**Post date:** [July 24, 2001, 3:46pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/8 "2001-07-24T15:46:41Z")

</div>

Hmm, second thought. Dont use a temporary table! And dont do the INSERT.

```auto

User.GET(USERID);
User2.VALIDATE("User ID",enteredUserID);
User2.VALIDATE(Password,enteredPassword);
IF User2.Password <> User.Password THEN
  ERROR('Wrong password');

```

it works for me. Just tested it 🙂 **_Soren Nielsen_, moderator Integration/Developer NOLUG** Edited by - SNielsen on 2001 Jul 24 16:47:25

---

<div class="post-metadata">

**Author:** ![vshal](https://avatars.discourse-cdn.com/v4/letter/v/7c8e57/32.png) [@vshal](https://www.dynamicsuser.net/u/vshal)\
**Post date:** [July 24, 2001, 4:01pm UTC](https://www.dynamicsuser.net/t/password-encryption/5201/9 "2001-07-24T16:01:57Z")

</div>

Hello, Thank you so much all of you for your support and time. I was finally able to get it, with the following code. Instead of user.get(userid) i have to use user.get(EnteredUserID) as the Authorization will be done by some 3 Person

[quote]  
User.GET(EnteredUserID); User2.VALIDATE(User2.“User ID”,EnteredUserID); User2.VALIDATE(User2.Password,Pwd); IF User.Password \<\> User2.Password THEN ERROR(‘Wrong password’) else error(‘Correct Password’); [\quote] Thank you all once again… I love this place…😉 Edited by - vshal on 2001 Jul 24 17:03:42

---

<div class="post-metadata">

**Author:** ![f3lix\_zhu](https://avatars.discourse-cdn.com/v4/letter/f/f04885/32.png) [@f3lix\_zhu](https://www.dynamicsuser.net/u/f3lix_zhu)\
**Post date:** [November 30, 2011, 7:48am UTC](https://www.dynamicsuser.net/t/password-encryption/5201/10 "2011-11-30T07:48:04Z")

</div>

vshal,

i’m facing some problem like you, i need to check the entered password match the user table password,

but the password is encrypted in user table password, my question is what encryption is used by nav? and do you have the encryption method?

because from source code above doesn’t include encryption method.

tq,

Felix
