Page 1 of 1
MSEncryptor
Posted: Fri 18 Apr 2014 03:37
by mervinpearce
Using SQL Server 2012 SP1 and using MSEncryptor I have an error 'String will be truncated' and encryption does not work. This is when setting any field to encrypt. I have made sure that my fields are more than twice as long in the table and using defaults on the encryption algorithm.
Any pointers?
Re: MSEncryptor
Posted: Fri 18 Apr 2014 14:36
by azyk
Hello,
If encryption of string fields is used, firstly, the data is encrypted, then additional information is added to data, and the obtained binary data is converted into hexadecimal format. In this case, data storage requires more than two times more space (one byte = 2 characters in hexadecimal).
You can find more details about SDAC Data Encryption at
http://www.devart.com/sdac/docs/encryption.htm
Best regards,
Andrey
Devart Team
www.devart.com
Re: MSEncryptor
Posted: Fri 18 Apr 2014 14:48
by mervinpearce
Thank you... I see my mistake... field must be binary type.
Re: MSEncryptor
Posted: Fri 18 Apr 2014 14:57
by Dimon
Feel free to contact us if you have any further questions.
Re: MSEncryptor
Posted: Sat 19 Apr 2014 07:19
by mervinpearce
Thanks for the excellent support.
Re: MSEncryptor
Posted: Tue 22 Apr 2014 09:12
by mervinpearce
Only tried after the long weekend... now I have an error saying 'Binary data cannot be encrypted'. Do you have a delphi example?
Re: MSEncryptor
Posted: Thu 24 Apr 2014 06:25
by mervinpearce
Solved... have to use varbinanry and not just binary
Re: MSEncryptor
Posted: Thu 24 Apr 2014 07:41
by azyk
Hello,
The 'Data type cannot be encrypted: Binary' occurs due to the fact that binary fields are not supported for storing encrypted data. This is because unused space in such field is filled with trailing zeros, therefore it is impossible to determine where encrypted data ends.
Use variable-length data types for storing, and then convert it into the required type on the client side using data mapping.