question

sumitava20 avatar image
sumitava20 asked

Data in certain fields in a table needs to be encrypted and later on decrypted to be used in sp. What should be the appropriate data type that can be used so that the same column can hold both the encrypted form and decrypted form of data?

The requirement is that the data in certain columns need to be encrypted after data is loaded and later on need to be decrypted so that these values can be used in calculations in a stored proc. My questions are :- Do I add new columns to the existing table to hold encrypted data in varbinary or something? What can be the appropriate data type that can hold both the encrypted value and the value after decryption in the same column?
encryptiondatatypescalculated-column
4 comments
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Also please suggest how can I approach this problem of encryption ?? Do i move out these fields in separate tables? Will it help me in any way ?? I will be grateful if I can get some quick suggestions on this?
0 Likes 0 ·
you may also wish to combine this question with your original question in the form of a comment.
0 Likes 0 ·
please post this question in the default section and not the meta-askssc section.
0 Likes 0 ·
Moved to Default section.
0 Likes 0 ·

1 Answer

· Write an Answer
Grant Fritchey avatar image
Grant Fritchey answered
If you're going to encrypt individual columns (not something I've done personally), I've always seen it done as binary storage.
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.