Re: encrypted value storage
- From: "Mike C#" <xyz@xxxxxxx>
- Date: Tue, 19 Feb 2008 22:04:08 -0500
Yes it will break. By definition SQL strips whitespace characters from the
end of VARCHARs. As soon as you get an encrypted value like
0x4041424320202020 (just a very shortened example), SQL Server will only
store the bytes for 0x40414243 in the VARCHAR column. This will break as
soon as you try to decrypt it since the VARCHAR won't be the correct block
length. If the data is normally accessed through a UDF, then converting the
underlying column to VARBINARY shouldn't be an issue for certain parties.
If it is a big issue, then the other parties need to consider another
strategy like converting the encrypted data to and from Base64 or using some
3rd party tools to encrypt the whole database instead. Otherwise, the other
parties need to decide if encryption of this column is important or not.
Straight BINARY/VARBINARY to VARCHAR will not work, and it will break one
day.
"bill" <rcairflyer@xxxxxxxxxxx> wrote in message
news:d4aa4099-7287-49b4-9bd9-07c1b37cff64@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
I have a varchar column that I would like to encrypt and store within
the same column. Encryption functions return binary. I would change
the column datatype , but certain parties will not change the datatype
to varbinary. I can store the value after explicitly converting the
binary to varchar...[ convert(varchar(), EncryptByKey(...)) ]. It
seems to work. Will this break one day? The data is normally
accessed through an abstracting UDF. Will this scheme survive?
Thanks,
Bill
.
- Follow-Ups:
- Re: encrypted value storage
- From: Erland Sommarskog
- Re: encrypted value storage
- References:
- encrypted value storage
- From: bill
- encrypted value storage
- Prev by Date: encrypted value storage
- Next by Date: Re: encrypted value storage
- Previous by thread: encrypted value storage
- Next by thread: Re: encrypted value storage
- Index(es):
Relevant Pages
|
|