2

I have an encrypted string/Number in the database(which is done by SQL server encryption and looks like "䚶ઙᷤ阹熂" ),now i need to decrypt this through c# code.How can i achieve this? Can anyone help me on this?

7
  • 1
    I think you should let the sql server decrypt the data again Commented Jul 5, 2012 at 6:40
  • You might wanna look here stackoverflow.com/questions/6491129/… Commented Jul 5, 2012 at 6:41
  • I am looking for a solution through c# code. Commented Jul 5, 2012 at 6:50
  • the encryption of such kind is for the purpose of security and I guess it is made so that it cannot be decrypted. Unless or until you know the logic of encryption. I might be wrong as I am still a beginner at C#. Commented Jul 5, 2012 at 7:00
  • In this scenario i am in need of decrypting it . I don't find any luck by googling.. Commented Jul 5, 2012 at 7:14

1 Answer 1

1

Do not store credit card information in a database. It's a recipe for trouble. Doing so will make you a very attractive target for hackers and, if they are successful in retrieving them, end your business and potentially ruin your life as well as the lives of those whose credit card numbers are stolen.

Also It is possible that storing such an information is illegal but depends upon the laws of you country. Please do check the guidelines.

If still you want to go ahead and do so and you want to store such an information then the just keep to the rule of ENCRYPT ENCRYPT ENCRYPT and never DECRYPT. Its like MD5 (i am not at all that you should just use algorithm like md5 for storing the credit card information) where you don't have an algorithm to decrypt but you can only encrypt the data. You can check the information entered matches the encryted data in the database by first encrypting the string with the same algorithm and then comparing it with the encrypted string in the database. Choose a good algorithm and a good and a secure server.

Be sure to choose an encryption algorithm that is secure and have not been broken yet.

Sign up to request clarification or add additional context in comments.

3 Comments

I am doing it in a demo project for the sake of learning .NET and SQL.
@NewBornDeveloper even i am a newbie.. learn it in a good way then.. their are million of programmers try to be a good programmer and not just a programmer. If you just want to learn about encrytion and descryption check out this thread stackoverflow.com/questions/202011/…
I can understand that.I was trying to solve a problem which i faced during my coding.Anyway thanks for the information.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.