locked
Encryption/Decryption of Excel file

    Question


  •  
    Hi All, 
    I am going to develop a small software which searches from the database. 
    Since the data is small, I thought of using EXCEL, but now my problem is when I sell the software, I dont want the users to view the Excel file and data. 

    Is Encryption/ Decryption a solution for this? 
    How can I protect the data from the user? 
    Please share your views in protecting the data.
    Friday, November 20, 2009 1:01 AM

Answers

  • If you just want to store and retrieve data from Excel which you need to protect, you can protect the Excel using password. But somebody can try to crack the password using some tools.

    So you are saying encryption is fools proof?

    If you password protect excel file using a strong password, I think using tools will take years to crack the password.

    As an added measure, you can encrypt the values before you write it into the excel file. While reading you can decrypt it and use it. So in this case, double layer of protection will be there.

    Thanks,
    A.m.a.L
    Dot Net Goodies
    Don't hate the hacker, hate the code
    • Marked as answer by VenkZ Saturday, November 21, 2009 12:53 AM
    Friday, November 20, 2009 10:49 AM

All replies

  • You can password protect the excel file.

    Check the link for how to implement it.

    http://stackoverflow.com/questions/915999/password-protecting-an-excel-file-in-c
    Thanks,
    A.m.a.L
    Dot Net Goodies
    Don't hate the hacker, hate the code
    Friday, November 20, 2009 4:25 AM
  • If you just want to store and retrieve data from Excel which you need to protect, you can protect the Excel using password. But somebody can try to crack the password using some tools.

    Instead of password, you can try to use .NET encryption feature to protect the data. You need to store the encrypted data . Then you can read the encrypted data from Excel and decrypt it before displaying it. In this scenario, you should not store the encryption key in the application. Because .NET assembly can be dis-assemble using tools such as redgate's .NET Reflector.  You need to keep the key with yourself. Please note that Excel needs to be installed and configured in the client PC if you use Excel COM object in your code.

    Alternatively you can use XML to store and retrieve encrypted/decrypted  data if your data size is small.

    Friday, November 20, 2009 9:05 AM
  • Alternatively you can use XML to store and retrieve encrypted/decrypted  data if your data size is small.///////

    Hi the records may go up to 10,000? and if I encrypt/decrypt I have store in memory stream right? then wat abt the performance?
    But the functionality is very small... One input and one output.
    Friday, November 20, 2009 9:21 AM
  • If you just want to store and retrieve data from Excel which you need to protect, you can protect the Excel using password. But somebody can try to crack the password using some tools.

    So you are saying encryption is fools proof?

    If you password protect excel file using a strong password, I think using tools will take years to crack the password.

    As an added measure, you can encrypt the values before you write it into the excel file. While reading you can decrypt it and use it. So in this case, double layer of protection will be there.

    Thanks,
    A.m.a.L
    Dot Net Goodies
    Don't hate the hacker, hate the code
    • Marked as answer by VenkZ Saturday, November 21, 2009 12:53 AM
    Friday, November 20, 2009 10:49 AM
  • yes i agree with A.m.a.L, even i have implemented Password protection in one of my project it works fine with client side and the password length is 11, i don't think any of the tool can hack this long password very easily...

    i don't think encrypting the data is a better option... its just a overhead for the application when we password protection for excel...



    Narayanan Dayalan - Zeetaa Business Solutions ------- Please "Mark As Answer", if my answer works well with ur Query
    Friday, November 20, 2009 12:28 PM
  • So you are saying encryption is fools proof?/////////
    Why are you yelling at me?
    I just want to clarify my questions.... As I told you the size may increase more than 10,000, thats why just worried abt performance....
    Anyways I will use double protection , thanks....
    Saturday, November 21, 2009 12:50 AM
  • Did I quote your reply?

    If you look into my reply, you can clearly see to whom I was replying.
    Thanks,
    A.m.a.L
    Dot Net Goodies
    Don't hate the hacker, hate the code
    Saturday, November 21, 2009 5:06 PM