AES-256 Encryption

Abhishek Rao 1 Reputation point
2020-12-03T08:09:07.237+00:00

Hi,

I Need to know is there a common AES-256 algorithm which support Encryption and decryption from Both C# and SQL server ?

1) Master Key
2) Certificate
3) Symmetric Key
4) EncryptbyKey

Above are already in place in the database for specific columns like password

How do I make the application compatible with Encryption handling data from such columns on the front end.
Eg: Password for a user (in terms of login authentication, change password such operations done through SP calls from the app)

The main question is, can I inherit or derive the symmetric key created in the above method to be used in the app for encrypt/decrypt compatible between the app and db?

I needed to encrypt and decrypt data from both end (SQL and Application)

Can anybody help me with this ?

Thanks,
Abhishek

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,196 questions
Transact-SQL
Transact-SQL
A Microsoft extension to the ANSI SQL language that includes procedural programming, local variables, and various support functions.
4,547 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Cheong00 3,471 Reputation points
    2020-12-03T09:25:40.947+00:00

    Most of your questions are answered here. Also check this page for considerations. (Say, you cannot use update statement accross encrypted and unencrypted fields directly)

    And then when you need to use it, simple enforce enforce encryption so the SQL Connection is encrypted, and automatically decrypted on your C# code.

    No code change other than connection string change is required on application side.