locked
Data Protection in a Text file (Cryptography and Certificate sample)

    Question

  • Hello,

    I was able to data protect a text file I'm using in app, and also read the protected file and unprotect it inside the code to use it (thanks to the Cryptography and Certificate sample).

    My question is the following:

    In this way my file is protected from the user reading it. 

    However a programmer who knows the data protection in Windows Store Apps, could get my data protected file, and unprotect it easily (using the descriptor : "Local=user" ).

    Why the data protection doesn't require some kind of key to use for it?

    How can i data protect my text file (of size: 1MB - 20MB) with a key, for extra security against other developers?

    (under these assumptions: the file has to be opened from my app, not from the cloud, and the option of credentials is not the case).

    thanks!


    • Edited by pf16mirage Sunday, September 14, 2014 2:10 PM
    Sunday, September 14, 2014 2:06 PM

All replies

  • Hi pf16mirage,

    Could DataProtectionProvider class help with your issue? I can see credentials is the only way to set password. Any scenario you don't want to use credential?

    --James


    <THE CONTENT IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, WHETHER EXPRESS OR IMPLIED>
    Thanks
    MSDN Community Support

    Please remember to "Mark as Answer" the responses that resolved your issue. It is a common way to recognize those who have helped you, and makes it easier for other visitors to find the resolution later.

    Monday, September 15, 2014 8:40 AM
    Moderator
  • Hi Jamles Hez and thanks for the reply,

    I was able successfully to use the DataProtectionProvider with provider "LOCAL=user" thanks to Microsoft's example.

    You refer using the same with the following providers: 

    • "WEBCREDENTIALS=MyPasswordName"
    • "WEBCREDENTIALS=MyPasswordName,myweb.com"

    ?

    Can you please help me with pointing me to some Microsoft's sample for this?

    What are these credentials? Are they the user's credentials? Can you please explain me how it works?

    Thanks!

    Tuesday, September 16, 2014 7:46 PM