Categories: MSDN / DotNet / Java / Scripts / Linux / PHP Ask - La ask - La Answer

Crypted data in MS SQL Server

Hi,

How can I store encrypted (with non symetrical keys) data (varchar) in MS
SQL Server using IIS and ASP pages (VBScript)?

Is there an integrated way to do it in MS SQL Server or VBScript?

Can it be done in VBScript?
If yes, do you know where I could find examples?

Do I need to add an external component?
If yes, do you know where I could find them?

Thanks in advance,
Thomas
[439 byte] By [Thomas MOULIN] at [2007-11-9 23:51:01]
# 1 Re: Crypted data in MS SQL Server
Same way you store plain text. Just store the encrypted text.

You may run into problems if you use a update or insert SQL statement
directly if you don't check for single quotes in the data and convert it to
two single quotes.
--
Eli Allen
eallen@bcpl.net

"Thomas MOULIN" <JOGISIJJZGZH@spammotel.com> wrote in message
news:3aa5211b$1@news.dev-archive.com...
>
> Hi,
>
> How can I store encrypted (with non symetrical keys) data (varchar) in MS
> SQL Server using IIS and ASP pages (VBScript)?
>
> Is there an integrated way to do it in MS SQL Server or VBScript?
>
> Can it be done in VBScript?
> If yes, do you know where I could find examples?
>
> Do I need to add an external component?
> If yes, do you know where I could find them?
>
> Thanks in advance,
> Thomas
>
Eli Allen at 2007-11-12 0:15:04 >
# 2 Re: Crypted data in MS SQL Server
the easiest way is to use a component like ASPCrypt from Persits.com. encrypt
the data and base64 encode it so you can insert it easily into the database.
note, there is one big danger - you need to store the key safely!

"Thomas MOULIN" <JOGISIJJZGZH@spammotel.com> wrote:
>
>Hi,
>
>How can I store encrypted (with non symetrical keys) data (varchar) in MS
>SQL Server using IIS and ASP pages (VBScript)?
>
>Is there an integrated way to do it in MS SQL Server or VBScript?
>
>Can it be done in VBScript?
>If yes, do you know where I could find examples?
>
>Do I need to add an external component?
>If yes, do you know where I could find them?
>
>Thanks in advance,
>Thomas
>
Michael Howard at 2007-11-12 0:16:04 >
# 3 Re: Crypted data in MS SQL Server
Hello,

SQL Server will encrypt the data in network packets sent between the client
and the server. To do this you will have to configure SQL Server to use
the Multiprotocol Net-Library and enable multi-protocol encryption from the
Server Network Utility.

Once the server is set up to use multi-protocol encryption, you will have
to configure the client to use the Multiprotocol Net-Library with the Client
Network Utility.

If you have SQL Server BOL look up Multiprotocol Clients or Encryption

Joe
Joe Jansen at 2007-11-12 0:17:14 >
# 4 Re: Crypted data in MS SQL Server
hi joe

you are quite correct about this - however, once the data is in the database
it is no longer encrypted. this may be fine - unless someone compromises
the database! :-(

also note, in SQL Server 2000, you can use encryption with any protocol,
not just the Multiprotocol net-lib (which is essentially an RPC call)

"Joe Jansen" <Jjansen@inco.com> wrote:
>
>Hello,
>
>SQL Server will encrypt the data in network packets sent between the client
>and the server. To do this you will have to configure SQL Server to use
>the Multiprotocol Net-Library and enable multi-protocol encryption from
the
>Server Network Utility.
>
>Once the server is set up to use multi-protocol encryption, you will have
>to configure the client to use the Multiprotocol Net-Library with the Client
>Network Utility.
>
>If you have SQL Server BOL look up Multiprotocol Clients or Encryption
>
>Joe
Michael Howard at 2007-11-12 0:18:09 >