Link to home
Start Free TrialLog in
Avatar of jana
janaFlag for United States of America

asked on

How to incorporate encryption method for developing in Microsoft Visual Basic when saving to a DB

We have MS VB 2012 and wanted to incorporate some sort routine that when we save to a MS SQL database or any other type of database, it can be encrypted then decrypted when read.  Is there way to go about it?  Please advice.
Avatar of aikimark
aikimark
Flag of United States of America image

You should be able to encrypt the database.  The database will then take care of the encrypting/decrypting work.  You shouldn't have to do anything at the application level.
SOLUTION
Avatar of Shaun Kline
Shaun Kline
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

aikimark:

We are using MSSQL; when you say "You should be able to encrypt the database", what do you mean exactly?

Shaun Kline:

Thanx, we are working on the code to incorporate the encryption.  

Last question:

After incorporating, what is your opinion on how we are going to use it? (that is, run the routine to every data or fields prior saving to the database)

SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Thank you very much,very interesting.  Unfortunately, since the apps will be working with different SQL instances (MSSQL & MYSQL), we have to maintain the encryption at coding in VB.

What is your opinion on our last question in ID: 40836208:

"After incorporating, what is your opinion on how we are going to use it? (that is, run the routine to every data or fields prior saving to the database)"
MySQL encryption could be accomplished with
* full disk encryption
* some middle-ware, like TrueCrypt or PGP, that might mount an encrypted volume that contains the MySQL database
* field-by-field encryption at the application level
https://dev.mysql.com/doc/refman/5.5/en/encryption-functions.html

The FDE is the simplest and would apply to both types of database.
What is the purpose for the encryption?

Are you looking to encrypt the data for data-at-rest reasons? Then a full database encryption is probably the way to go.

Are you looking to encrypt sensitive data, such as phone numbers, credit card numbers or Social Security Numbers? You have options. Both SQL Server and MySQL include encryption algorithms so you can encrypt/decrypt the data on the database side via stored procedures; or you can use .Net's encryption class to encrypt the data prior to sending it to the database and decrypt when retrieving the data. Both have positives and negatives, so you would need to research and determine which is best for your needs.
Avatar of jana

ASKER

Thanx for the MySQL encryption info; we'll pass this info forward.  Unfortunately, the purposes why encrypting SQL is not viable to us, is because it will not be up to us to do it.  That is, the apps we are working on is an inhouse tool and is running in 3 location with seperate independant IT administrations, where 1 location is MySQL.  If each location would adhere to SQL encryption then we would be not necessary to encrypt via VB.

That said, Yes, we are looking to encrypt sensitive data such as phone, address, hence, Human Resources info.

Going back to entry ID: 40836208: After incorporating the recommended encryption method to our source code, what is your opinion on how we are going to apply it? (that is, run the filed data thru the encryption routine before saving to the DB thus saving encrypted data instead of legible data)"
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jana

ASKER

Great Info!!!  Listen, you raised more interesting questions, but as for this particular question, it has been 100% answered!

Will proceed to close.

Thanx all for your great assistance!