MSEncryptor

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
mervinpearce
Posts: 16
Joined: Mon 08 Oct 2012 14:08

MSEncryptor

Post by mervinpearce » Fri 18 Apr 2014 03:37

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?

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: MSEncryptor

Post by azyk » Fri 18 Apr 2014 14:36

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

mervinpearce
Posts: 16
Joined: Mon 08 Oct 2012 14:08

Re: MSEncryptor

Post by mervinpearce » Fri 18 Apr 2014 14:48

Thank you... I see my mistake... field must be binary type.

Dimon
Devart Team
Posts: 2885
Joined: Mon 05 Mar 2007 16:32

Re: MSEncryptor

Post by Dimon » Fri 18 Apr 2014 14:57

Feel free to contact us if you have any further questions.

mervinpearce
Posts: 16
Joined: Mon 08 Oct 2012 14:08

Re: MSEncryptor

Post by mervinpearce » Sat 19 Apr 2014 07:19

Thanks for the excellent support.

mervinpearce
Posts: 16
Joined: Mon 08 Oct 2012 14:08

Re: MSEncryptor

Post by mervinpearce » Tue 22 Apr 2014 09:12

Only tried after the long weekend... now I have an error saying 'Binary data cannot be encrypted'. Do you have a delphi example?

mervinpearce
Posts: 16
Joined: Mon 08 Oct 2012 14:08

Re: MSEncryptor

Post by mervinpearce » Thu 24 Apr 2014 06:25

Solved... have to use varbinanry and not just binary

azyk
Devart Team
Posts: 1057
Joined: Fri 11 Apr 2014 11:47
Location: Alpha Centauri A

Re: MSEncryptor

Post by azyk » Thu 24 Apr 2014 07:41

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.

Post Reply