Re: encrypted value storage



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


.



Relevant Pages

  • Re: Meganets "unbreakable" cryptography? Im skeptical.
    ... There may be parties that really should be using strong ... encryption and aren't, for whatever reasons, but they aren't going to be ... reading this newsgroup. ...
    (sci.crypt)
  • Re: Meganets "unbreakable" cryptography? Im skeptical.
    ... There may be parties that really should be using strong ... > encryption and aren't, for whatever reasons, but they aren't going to be ... K&R answers, C books, etc: http://users.powernet.co.uk/eton ...
    (sci.crypt)
  • Re: How can I stop spying on my conversations?
    ... No. IM networks are notoriously reluctant to implement encryption, ... agencies, different laws). ... Me and my parties use Macs and Adium, which has the OTR built-in, so ... Unless you're a network admin or can get netadmin's help, ...
    (microsoft.public.security)
  • Re: password encrption hash function
    ... Or you can use some server side encryption provided by 3rd parties. ... example the ones that stay in FAQs ...
    (microsoft.public.sqlserver.security)