473,587 Members | 2,321 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB 2005 and Content Security Question

Hi All

Bit of a newbie at this stuff but was wonering if anyone could offer me some
advice on a vb application and securing data.

I have a fairly basic vb 2005 application that connects to a sql 2005
database (Think of it as a journal). Some of the entries in this application
contain sensitive data that needs to be kept secure. What I am wondering is
the best method of doing this?

Should I encrypt the data in the application and store the encrypted text in
the database for the secure entries and then decrypt it on retrieval or
should I rely upon the security of the SQL server?

What do I need to consider in relation to :-

1. someone reverse engineering the application
2. intercepting the network traffic between the application and the sql
server
3. others having access to the sql server
4. anything else I might not have considered.

I appreciate any assistance or advice anyone might have to offer.

Regards
ILR
Jan 4 '07 #1
8 1070
Hello ILR,

For your scenario, must the sensitive data be stored in SQL Server database
or if it's some simple data that can also be stored in configuration
file(such as app.config). In .NET Framework 2.0, there does provide many
new data protection/secure features that can help us conveniently secure
our application data. If the data should be stored in SQL Server, since
SQL server access include network connection and data transfering, I
suggest you manually encrypt the data if the size is not very huge.

You can consider using the DPAPI component in .NET
2.0(System.Secu rity.Cryptograp hy.ProtectedDat a class). You can have a look
at the following MSDN reference about how to perform data protection in
.NET:

#How to: Use Data Protection
http://msdn2.microsoft.com/en-us/lib...41(vs.80).aspx

here is another web article introduce other net security features in .NET
2.0

#New Security Features in .NET 2.0
http://www.theserverside.net/tt/arti...wSecurityFeatu
res

In addition, if you have some sensitive configuration setting that need to
secure and want to store in configuration file, you can have a look at the
following article:

#How To: Encrypt Configuration Sections in ASP.NET 2.0 Using DPAPI
http://msdn2.microsoft.com/en-us/library/ms998280.aspx

Though the above article is targeting ASP.NET web.config, the function also
apply for normal .net application(con sole or winform), see a former thread:

#Encryption of application configuration block
http://groups.google.com/group/micro.../browse_thread
/thread/1bbeeb01ae5ca5c 6/70dd27a4598ab06 0?

Hope this helps you.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

=============== =============== =============== =====

Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.

=============== =============== =============== =====

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 4 '07 #2
Thanks for your response Lan,

Please feel free to let me know if you have any further questions on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 5 '07 #3
OK I think I have a solution using DPAPI and a hashed password , I would
appreciate your feedback.

Store a password as an MD5 hash in the database. When the user wants to
save a secret entry to the database they are asked for a password (different
to the windows user password to provide additonal security) which is hashed
and compared to the hashed password in the database. If they are the same it
encrypts the text using DPAPI (using the protecteddata class with currentuser
scope) and uses the password value as the additional entropy, storing the
encrypted data in the database. The decryption process again askes for the
password, compares the hash values and then decrypts the data from the
database.

If I understand correctly this should prevent anyone accessing the
information by reverse engineering the application, intercepting the network
traffic or accessing the sql server?

Does that make sense? Anything else I should consider?

Regards
Ian



"Steven Cheng[MSFT]" wrote:
Thanks for your response Lan,

Please feel free to let me know if you have any further questions on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 5 '07 #4
Thanks for your reply Lan,

My comments below:

If I understand correctly this should prevent anyone accessing the
information by reverse engineering the application, intercepting the
network
traffic or accessing the sql server?
=============== =============== =

I think it ok. And here is an overall analysis over your application's data
process:

** in database and over network, since the data is in encrypted form, it is
secure.

** in your application, since you use DPAPI, so you do not need to worry
about the encryption key(the operating system help you manage it).

so the only potential threat is that if any one can access your program's
run memory and inspect the inmemory decrpypted data. However, I think this
is quite rare case and is not protectable through application code. so you
can feel free to use your current pattern.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 5 '07 #5
Hi Steven

Wondering if you can help?

I'm having trouble converting the byte array retrurned by
dataprotect.pro tect to a string that I can store in my database and then
retrieve later to be decrypted.

I've tried using UnicodeEncoding .ASCII.GetBytes to create the byte array for
encryption which returns the byte array ok but can't seem to covert it into a
string to display the encrypted data. I only get what I assume is the first
char of the encrypted data.

Any ideas
Appreciate any assistance.
Ian



"Steven Cheng[MSFT]" wrote:
Thanks for your reply Lan,

My comments below:

If I understand correctly this should prevent anyone accessing the
information by reverse engineering the application, intercepting the
network
traffic or accessing the sql server?
=============== =============== =

I think it ok. And here is an overall analysis over your application's data
process:

** in database and over network, since the data is in encrypted form, it is
secure.

** in your application, since you use DPAPI, so you do not need to worry
about the encryption key(the operating system help you manage it).

so the only potential threat is that if any one can access your program's
run memory and inspect the inmemory decrpypted data. However, I think this
is quite rare case and is not protectable through application code. so you
can feel free to use your current pattern.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 9 '07 #6
Hi Lan,

For convert binary data into string/text format, you should use base64
encoding, e.g.

.net framework has provided two methods for you to do the convertion:

System.Convert. FromBase64Strin g()
System.Convert. ToBase64String( )

For System.Text.Enc oding namespace classes, they're used for convert
between binary and string based on a Charset , and this is used when you
are processing Text data and care about the charset of different
language/region.

Please feel free to let me know if there is anything you wonder.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead

This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 9 '07 #7
Hi Lan,

Does this helps some? Please feel free to post here if you have any further
question.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 12 '07 #8
Thanks Steven

That has helped.
I appreciate your assistance.

Ian

"Steven Cheng[MSFT]" wrote:
Hi Lan,

Does this helps some? Please feel free to post here if you have any further
question.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead
This posting is provided "AS IS" with no warranties, and confers no rights.

Jan 12 '07 #9

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

Similar topics

0
2112
by: Unigroup of New York | last post by:
Content-Type: multipart/mixed; boundary="------------C465DF38DCB38DD2AF7117E0" Lines: 327 Date: Tue, 15 Feb 2005 23:36:38 -0500 NNTP-Posting-Host: 24.46.113.251 X-Complaints-To: abuse@cv.net X-Trace: fe12.lga 1108528794 24.46.113.251 (Tue, 15 Feb 2005 21:39:54 MST) NNTP-Posting-Date: Tue, 15 Feb 2005 21:39:54 MST Xref:...
5
512
by: Mike Owen | last post by:
Hi, I have just used the import Wizard to import a VS 2003 app to VS 2005. I have a lot of work to do to enable it to compile successfully with all the errors and warnings it gave me, but as a starting point the compiler can no longer find the function as at the bottom of this posting, that was in the Global.asax.vb file. All the...
2
1646
by: rjack | last post by:
I'm using VS 2005 Beta 2. In VS 2003, the Page directive in an aspx page has Language and CodeBehind attributes. You can have the language be different than the code behind file language. For instance, you can have Language="vb" CodeBehind="classA.cs" In VS 2005, the CodeBehind attribute seems to have been replaced with
8
1523
by: Mike Owen | last post by:
Hi, I am trying to pre-compile a project prior using ASP.Net 2.0, VS 2005, to putting it onto a live server. The reason for doing this is that other people have access to the server, and I thereofre want to keep the code secure. If I use the 'Build/Publish Web Site' option, it asks me to tell it the 'Target location' which in this case...
8
6450
by: Phil Lee | last post by:
I'm sure this is possible but I just can't see how to do it. I want to add schemas to my solution and have C# classes automatically generated from them. I can see how to generate typed DataSet's with the MSDataSetGenerator custom tool. Is there something similar for simple schemas? Regards Phil Lee
6
2713
by: | last post by:
Hi all, is there a better way to stream binary data stored in a table in sql 2005 to a browser in .net 2.0? Or is the code same as in .net 1.1? We noticed that in certain heavy load scenarios, every now and then the client would timeout and have to re-initiate the request... TIA!
0
7918
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7843
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
8206
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7967
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
6621
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
5392
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3840
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3875
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2353
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

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.