Click here to Skip to main content
15,907,395 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Dear Experts,
I have to encrypt one of my projects sensitive data and stores in database. So what is the best approach to do and how, please explain me as I am new in cryptography.

Thanks

What I have tried:

I have tried with base64 encoding and also trying to do RSACryptoServiceProvider class.
Posted

1 solution

First off, base64 is not encryption. It's a translation algorithm, which doesn't do anything cryptographic! It's there to translate data into a form that can be easily sent over non-binary channels, not to make it secure in any way shape or form.

If you want to protect sensitive data, what you should use depends on what kind of data you are protecting. If it's passwords, then you don't want to use encryption at all, as it's far too insecure! Use Hashing instead: Password Storage: How to do it.[^]

For data which needs to be encrypted, there are still a huge number of options depending on how you are storing it. If it's in a DB, then the "best" solution may be to encrypt the whole DB and let SQL take care of decryption for you. If it's file based, then AES may be the simplest: Aes Class (System.Security.Cryptography)[^] - the link includes an example.
 
Share this answer
 
Comments
CPallini 15-Feb-16 4:52am    
5.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900