1. DBDev's Avatar

    Is it possible to encrypt data in a WP app using C# and then be able to save the encrypted data to Skydrive to be decrypted in a windows desktop program?

    I want to create a password saving app that can sync to the PC but I am no expert when it comes to encryption/decryption ;) The methods I have found seems to encrypt the data using some kind of number from the phone which means that only that phone can decrypt the data. That will not work in my case.
    01-10-2013 03:12 PM
  2. hopmedic's Avatar
    Yes - I just answered on your other post. Give @gcaughey (Ginny Caughey) a shout on twitter. She does it in Password Padlock. I'm sure she'll point you in the right direction - IIRC she's a WP MVP.
    01-11-2013 11:58 PM
  3. DBDev's Avatar
    Unfortunately I don't have twitter :(
    01-12-2013 03:16 AM
  4. SOMEnameItried's Avatar
    Yeah, you'd just need to make sure both places (app and desktop) have the same key.

    If you think about it, this has been happening already and quite a while, It's not really encryption, but just ways to compress files like media.

    Anyway, yes. It is do-able. For C# I think you get more options if you use .NET 4.5 Framework. They have more SHA options in there.
    01-12-2013 12:52 PM
  5. DBDev's Avatar
    Ok, but do you know how to do it?
    01-12-2013 01:18 PM
  6. SOMEnameItried's Avatar
    Yes I do, but I thought you wanted advice on the direction to go.

    Anyway, here is someone's post on the subject to help you out. This practice still works today, and if you abstract these items, supply interfaces, and unit test them, I'm sure it'll make building it even easier for you.

    C# Encryption

    DBDev likes this.
    01-12-2013 02:21 PM
  7. DBDev's Avatar
    Thank you very much! I will try that soon :)
    01-12-2013 02:31 PM
  8. SOMEnameItried's Avatar
    You're welcome!

    Also as a fun tid-bit of info (because encryption can get hairy) here's something on web encryption (and login). While it doesn't directly affect what you're after, it does a good job at explaining some of the pitfalls of how passwords get broken (which can apply with data too). So when a user connects to their SkyDrive, this should start getting you to think about how someone might listen in on the connection between a user's phone and the it (the SkyDrive) and where decyption should take place in the process.

    Secure Salted Password Hashing - How to do it Properly

    DBDev likes this.
    01-12-2013 06:08 PM
  9. DBDev's Avatar

    That doesnt seem to work in WP. I get the following errors:
    error CS0117: 'System.Security.Cryptography.SymmetricAlgorithm' does not contain a definition for 'Create'
    error CS0117: 'System.Text.Encoding' does not contain a definition for 'ASCII'
    error CS0117: 'System.Text.Encoding' does not contain a definition for 'ASCII'
    01-15-2013 06:40 AM
  10. DBDev's Avatar
    I may should add that it works for desktop.
    01-15-2013 07:01 AM
  11. SOMEnameItried's Avatar
    this might help provide you with direction

    How to encrypt data in a Windows Phone app
    01-15-2013 09:37 AM
  12. DBDev's Avatar

    That method uses some unique number from the phone so I will not be able to decrypt it on another phone or on the computer :(
    01-16-2013 02:02 AM
  13. SOMEnameItried's Avatar
    At that point, I'd say you have some investigating to do! :)

    This happens in software and using apis / sdks quite often, so don't get discouraged.

    You might want to take a look at the ProtectedData's namespace, and see if there are other options (classes, methods, etc...). Still you're right, you can't encrypt on the phone with its pin and different encryption classes than the desktop. You also may want to search for variations in regards to encryption. For example, some people maybe trying to encrypt a different way and asking for help doing that with email. I don't know if they're trying to go for the same ambitious level you are (by going to desktop), but maybe that helps a little in guiding you.

    01-16-2013 09:39 AM

Similar Threads

  1. WP8 whole device encryption?
    By that guy with the face in forum Other Operating Systems
    Replies: 5
    Last Post: 05-21-2015, 11:08 AM
  2. Encrypted Email on ActiveSync
    By tk-093 in forum Other Operating Systems
    Replies: 1
    Last Post: 11-28-2012, 12:06 PM
  3. Encryption question
    By cstenson in forum Other Operating Systems
    Replies: 4
    Last Post: 11-08-2012, 05:05 AM
  4. WP 7.5 and local mail encryption
    By oysteinhermansen in forum Other Operating Systems
    Replies: 2
    Last Post: 02-27-2012, 10:48 AM
  5. KIK sends password, messages without encryption
    By 1jaxstate1 in forum General Phone Discussion
    Replies: 3
    Last Post: 06-29-2011, 03:03 PM