Showing posts with label everytime. Show all posts
Showing posts with label everytime. 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!!!

Friday, March 9, 2012

Encrypt password field

hello guys! i have a question hope you'll help me..how can i encrypt the data that is stored in my password field everytime i insert value to it and decrypt it if i want to retrieve it? thanks in advance!!I dont think you can in simple SQL. BUT some vendors (like Oracle) provide with functions specifically for that. E.g If you use Oracle 10g, you can use the Encrypt function, dbms_crypto...etc.

if you do use oracle 10g, here is a good link for that:

Mysql has a far simpler and equally powerful Encrypt function. just check out the manual if you do use Mysql.

or here is the link:

http://dev.mysql.com/doc/refman/5.0/en/encryption-functions.html

good luck|||Im sorry, somehow the link didnt show up. Here it is if you use 10g:

http://www.oracle.com/technology/pub/articles/oracle_php_cookbook/ullman_encrypt.html|||daimous, looking at all your other posts, i'm going to guess that you are using microsoft sql server, and therefore move this thread to that forum|||... in which case this will probably interest you :D

http://www.dbforums.com/showthread.php?t=1217730|||hello guys! i have a question hope you'll help me..how can i encrypt the data that is stored in my password field everytime i insert value to it and decrypt it if i want to retrieve it? thanks in advance!!
If you are decrypting passwords, you don't understand how they are supposed to be used. Passwords should not need to be decrypted.|||i need to decrypt my password from my database since i encrypted it before storing it to my database, in the first place. So before i can get the "REAL" password i need to decrypt it..right? well anyway, can i get some more inputs..|||i need to decrypt my password from my database since i encrypted it before storing it to my database, in the first place. So before i can get the "REAL" password i need to decrypt it..right?
Wrong.

You encrypt your password using some algorithm and store the results in the database.
When your user logs in with a password, thier password is encrypted using the same algorithm. If the results match what is stored in the database, the user's login is verified.

You can write a sproc to encrypt the submitted password and return success or failure after comparing to the stored encryption string.

Thus there is no need to decrypt passwords.

Wednesday, February 15, 2012

Empty dialog box on startup of Management Studio Express

Hi,
Everytime I start Studio Express I get an empty dialog box. I've seen some
posts about a similar problem but they were linked to upgrades. I have not
upgraded SQLExpress so there must be something else that causes it.
The only thing that I have done recently was to delete few users from a
database and instance.
I'm using SQLExpress 2005.
Any ideas what could be happening and how to troubleshoot this?
ThanksHi
I would suggest removing and re-installing, but other posts say fixing .NET
Framework 2 .0 fixed it!
John
"bogdan" <bogdan@.company.com> wrote in message
news:OvOLTAplIHA.2396@.TK2MSFTNGP02.phx.gbl...
> Hi,
> Everytime I start Studio Express I get an empty dialog box. I've seen
> some posts about a similar problem but they were linked to upgrades. I
> have not upgraded SQLExpress so there must be something else that causes
> it.
> The only thing that I have done recently was to delete few users from a
> database and instance.
> I'm using SQLExpress 2005.
> Any ideas what could be happening and how to troubleshoot this?
> Thanks
>