|
-
Feb 13th, 2009, 01:21 AM
#1
Thread Starter
Addicted Member
Encrypt data from database
Hi friends,
I am using Asp.Net 2.0 application. I have a user information form like username, password,name,lastname etc., I stored this information in a database. In the user information form one view button available. Suppose user click the view button, i show the information of user from database. What my query is that i need to show some fields like encrypted method from database. ie password and mobile no like **** or some encrypted no.Is it possible in .Net that encrypted data from database to our front end.
Hope Your's reply.
Failing to plan is Planning to fail 
-
Feb 13th, 2009, 02:43 AM
#2
Re: Encrypt data from database
Hey,
Are you using the Membership, Role and Profile Provider that ship with ASP.NET or have you created your own database?
Gary
-
Feb 13th, 2009, 03:27 AM
#3
Thread Starter
Addicted Member
Re: Encrypt data from database
Hi,
Thanks for yours reply. I am asking how encrypt data??
Failing to plan is Planning to fail 
-
Feb 13th, 2009, 03:33 AM
#4
Re: Encrypt data from database
Hello,
I am aware of what the question was, the reason that I am asking if becuase the encryption and retrieval of passwords is provided out of the box if you are using the Membership Provider which comes shipped with ASP.NET.
So again, are you using the Memebership provider, or are you using your own custom code?
Gary
-
Feb 13th, 2009, 03:34 AM
#5
Thread Starter
Addicted Member
Re: Encrypt data from database
I am using my own custom code. Not use membership.
Failing to plan is Planning to fail 
-
Feb 13th, 2009, 03:39 AM
#6
Re: Encrypt data from database
In which case you are going to want to start looking into using the System.Security.Cryptography Namespace which includes methods for encrypting data.
Gary
-
Feb 13th, 2009, 03:42 AM
#7
Thread Starter
Addicted Member
Re: Encrypt data from database
while user want to view his details at that time i show username and password address,phone no.
I want to encrypt password and phone no only.
Failing to plan is Planning to fail 
-
Feb 13th, 2009, 03:46 AM
#8
Re: Encrypt data from database
I am not quite sure I follow what you are saying but as a brief overview, I would have thought something like this would work for you:
When the user resgisters with your site you are going to gather their information, i.e. username, password, address, phone etc. Once you have collected these, and before they are sent to the database, encrypt the password and phone number and store them in the database in their encrypted form. When you then display the informtion to the user, you can decrypt them.
Having said that, it is more normal to hash the password rather than encrypt it. i.e. it is not possible to retrieve the password, but rather reset it to something else.
Gary
-
Feb 13th, 2009, 03:53 AM
#9
Thread Starter
Addicted Member
Re: Encrypt data from database
ok gary. How will encrypt the data and decrypt again. If it is possible , could you please tell me how?
Failing to plan is Planning to fail 
-
Feb 13th, 2009, 03:59 AM
#10
Re: Encrypt data from database
Hello,
There are various ways that you can do this, and you have to make a decision about what kind of encryption that you want to use, that is why I pointed you at the MSDN reference so that you can read up on the different classes available.
The only examples that I would have are in C#, which I am not sure would be much help for you.
If you search through the code banks though, I am sure there are examples there.
Gary
-
Feb 13th, 2009, 04:01 AM
#11
Re: Encrypt data from database
-
Feb 13th, 2009, 04:05 AM
#12
Thread Starter
Addicted Member
Re: Encrypt data from database
Failing to plan is Planning to fail 
-
Feb 13th, 2009, 06:47 AM
#13
Frenzied Member
Re: Encrypt data from database
Hi!
May I ask what the purpose is of encrypting the data in the first place? Do you have some dba's that you don't trust? Or do you store information that is strictly confidential like?
Anyway,
When it comes to passwords, the best option is to simply hash +salt it. Of course this means there is no way to read the password in plain text again, but I don't see when this case would ever happen.
Not exactly direct answers to your questions, but perhaps give you some ideas to your solution?
/henrik
-
Feb 14th, 2009, 02:42 PM
#14
Re: Encrypt data from database
I think the answer is simpler. You want your information to appear as ****** on the form for viewing this information. So you simply don't show it or retrieve it from the database. You simply place ****** on the form.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|