Showing posts with label posible. Show all posts
Showing posts with label posible. Show all posts

Sunday, March 11, 2012

Encrypt/decrypt MS SQL 2005

hi guyz!! is it posible to ecnrypt data everytime i insert it to a table and decrypt it everytime I select it using the MS SQL 2005 alone?

like for example i have this query statement below

insert username,password users values ('daimous','my_password')

what i want is every time i insert a value to the password column that value should be encrypted first.

select username,password from users

everytime i select the value of the password column should decrypted.
Thanks in advance!!!Passwords should never need to be decrypted.

The standard method of handling them is to store the encrypted value in the database. When a user logs in, the password they submit is encrypted using the same algorithm and compared to the stored encrypted value.

Passwords can thus use one-way encryption algorithms, which are more secure than two-way algorithms.

If you would like a function for one-way password encryption, I can post one for you.|||SQL 2005 comes with two functions "EncryptByKey" and "DecryptByKey". If you have BOL installed on your machine, look over this article:
ms-help://MS.SQLCC.v9/MS.SQLSVR.v9.en/udb9/html/38e9bf58-10c6-46ed-83cb-e2d76cda0adc.htm|||how can i check is BOL is installed in my sql server?|||Query Analyzer/help.

And it should be in your Windows Start menu as well.|||Does SQL Express 2005 edition has it?|||Dunno. But here it is on Microsoft's site, and I'm sure you can download it somewhere. I downloaded 2005's Books Online.
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ga-gz_4z51.asp|||I've already got an idea on how to encrypt data by using the EncryptByKey but when i try to decrpyt it using the DecryptByKey it doesn't return the original text. I've already posted that problem HERE (http://www.dbforums.com/showthread.php?t=1606236). COuld anyone help me on this..thanks!!!

Encrypt whole database in Sql 2005 Express?

Hello
Is it posible to encrypt whole database in Sql 2005 Express. I need it for
deployment process of my application and hiding database structure?
Or if not is good solution to use third party software for this propose?
Thank you
MilanB
The easiest way to encrypt a whole database is to put it in an encrypted
NTFS directory. That has some performance implications obviously and may or
may not do what you want it to depending on who you want to hide the data
from.
This posting is provided "AS IS" with no warranties, and confers no rights.
Use of included script samples are subject to the terms specified at
http://www.microsoft.com/info/cpyright.htm
"MilanB" <MilanB@.discussions.microsoft.com> wrote in message
news:B52AF8B2-F961-4436-99A4-DD27DB353168@.microsoft.com...
> Hello
> Is it posible to encrypt whole database in Sql 2005 Express. I need it for
> deployment process of my application and hiding database structure?
> Or if not is good solution to use third party software for this propose?
> Thank you
> MilanB
|||hi,
MilanB wrote:
> Hello
> Is it posible to encrypt whole database in Sql 2005 Express. I need
> it for deployment process of my application and hiding database
> structure?
> Or if not is good solution to use third party software for this
> propose?
regarding "hiding database structure", you can perhaps deny VIEW DEFINITION
permissions
http://msdn2.microsoft.com/en-us/library/ms175808.aspx and
http://msdn2.microsoft.com/en-us/library/ms187113(en-us,VS.90).aspx , even
at the database "securable" level..
the other traditional permission (SELECT/INSERT/UPDATE/DELETE/EXEC) should
be managed as well as in any security concerned scenario... drop the "Guest"
database user and define an appropriate object access policy..
Andrea Montanari (Microsoft MVP - SQL Server)
http://www.asql.biz/DbaMgr.shtmhttp://italy.mvps.org
DbaMgr2k ver 0.16.0 - DbaMgr ver 0.61.0
(my vb6+sql-dmo little try to provide MS MSDE 1.0 and MSDE 2000 a visual
interface)
-- remove DMO to reply