473,414 Members | 1,567 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,414 software developers and data experts.

Databinding and encrypted password

Hi NG,

I don't know if I'm just missing the forest through the trees, or if it
is really that complicated:

I want to save a password that is entered/changed through a text control
in a form. The control is bound to a dataset and the password shall be
stored as an encrypted text in the database.

I first tried to control the en- and decryption in the textbox's Format
and Parse handler but I ended up in sometimes having the password either
unencrypted or twice encrypted in the db.

Then I tried to use Enter and Leave handlers to de- and encrypt the
password before saving but this way, too, I can end up with unencrypted
oder twice encrypted passwords in the db.

Did somebody have this kind of problem before and knows a solution or
could point me to the right direction? I searched the archives but could
not find anything fitting my case.

Thanks in advance.
Regards
Roland
Nov 17 '05 #1
2 2204
Roland,

Are you controlling the update and query manually? I would wrap the
call to update in a set of methods you could call which will do the
encrypting/decrypting for you when you update/query the database. This way,
you don't have to worry about the controls doing the encrypting.

Ideally, you would place this kind of functionality in the buisness
layer (or data layer, depending on your design), and it wouldn't be left to
the user to encrypt/decrypt these values.

Hopet his helps.

--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Roland Riess" <ce******@gmx.net> wrote in message
news:uE**************@TK2MSFTNGP12.phx.gbl...
Hi NG,

I don't know if I'm just missing the forest through the trees, or if it is
really that complicated:

I want to save a password that is entered/changed through a text control
in a form. The control is bound to a dataset and the password shall be
stored as an encrypted text in the database.

I first tried to control the en- and decryption in the textbox's Format
and Parse handler but I ended up in sometimes having the password either
unencrypted or twice encrypted in the db.

Then I tried to use Enter and Leave handlers to de- and encrypt the
password before saving but this way, too, I can end up with unencrypted
oder twice encrypted passwords in the db.

Did somebody have this kind of problem before and knows a solution or
could point me to the right direction? I searched the archives but could
not find anything fitting my case.

Thanks in advance.
Regards
Roland

Nov 17 '05 #2
Hi Nicholas,

Nicholas Paldino [.NET/C# MVP] wrote:
Roland,

Are you controlling the update and query manually? Yes, I am.
I would wrap the
call to update in a set of methods you could call which will do the
encrypting/decrypting for you when you update/query the database. This way,
you don't have to worry about the controls doing the encrypting.

I think that is a good idea, I was too much clinging to the databinding
mechanisms of the controls - seems like if I wasn't wrong about the
forest and the trees :-)

Thanks a lot for pointing me to the right direction!

Regards
Roland
Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: sffan | last post by:
I am new to database programming and was curious how others solve the problem of storing encrypted in data in db table columns and then subsequently searching for these records. The particular...
6
by: Ian Davies | last post by:
Hello I would like to query the user table of the mysql database from my VB application to check that a user's password entered in a text field on a form corresponds to that users password in the...
2
by: Jill Elaine | last post by:
I am building an Access 2002 frontend with linked tables to an encrypted Paradox 7 database. When I first create these linked tables, I'm asked for the password to the encrypted Paradox database,...
8
by: KRoy | last post by:
I have a password stored in the Registry encrypted using System.Security.Cryptography DES Algorithm. I supplied it a password and a Initialization Vector. I am trying to decrypt it using the...
5
by: Michael Sperlle | last post by:
Is it possible? Bestcrypt can supposedly be set up on linux, but it seems to need changes to the kernel before it can be installed, and I have no intention of going through whatever hell that would...
2
by: Bernard Dhooghe | last post by:
The information center writes: "Encryption Algorithm: The internal encryption algorithm used is RC2 block cipher with padding, the 128-bit secret key is derived from the password using a MD2...
0
by: danishce | last post by:
I want to generate 8 byte key using CBC MAC by applying encryption to whole message in vb.net.My code is: //Main form Code Imports System.Security.Cryptography Dim plainText As String ...
5
by: Shmuel | last post by:
Hello, Is it possible to give to mysql_connect an encrypted (md5 or sha1) password? If not is there a workaround? I store passwords for users in database and don't want to use plain text...
4
n8kindt
by: n8kindt | last post by:
i'm trying to create a secure scenario where no one will be able to know our encrypted database passcode. BUT if they login to a form in another database successfully, it will open the encrypted...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.