Welcome to the Windows Central Forums Create Your Account or Ask a Question Answers in 5 minutes - no registration required!
Results 1 to 13 of 13
  1. DBDev's Avatar
    Member

    Posts
    2,387 Posts
    Global Posts
    2,395 Global Posts
       #1  
    Hi!

    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.
  2. #2  
    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.
    - Rich


    WPCentral.com | WPCentral Store | Mobile Nations Forum Rules

    Join Bing Rewards and get rewarded - and get me a few bonus points!
  3. DBDev's Avatar
    Member

    Posts
    2,387 Posts
    Global Posts
    2,395 Global Posts
       #3  
    Unfortunately I don't have twitter :(
  4. #4  
    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.
  5. DBDev's Avatar
    Member

    Posts
    2,387 Posts
    Global Posts
    2,395 Global Posts
       #5  
    Ok, but do you know how to do it?
  6. #6  
    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

    Cheers,
    Kelly
    Thanked by:
    DBDev 
  7. DBDev's Avatar
    Member

    Posts
    2,387 Posts
    Global Posts
    2,395 Global Posts
       #7  
    Thank you very much! I will try that soon :)
  8. #8  
    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

    Cheers,
    Kelly
    Thanked by:
    DBDev 
  9. DBDev's Avatar
    Member

    Posts
    2,387 Posts
    Global Posts
    2,395 Global Posts
       #9  
    Hi!

    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'
  10. DBDev's Avatar
    Member

    Posts
    2,387 Posts
    Global Posts
    2,395 Global Posts
       #10  
    I may should add that it works for desktop.
  11. #11  
    this might help provide you with direction

    How to encrypt data in a Windows Phone app
  12. DBDev's Avatar
    Member

    Posts
    2,387 Posts
    Global Posts
    2,395 Global Posts
       #12  
    Hi!

    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 :(
  13. #13  
    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.

    Cheers,
    Kelly

Similar Threads

  1. WP8 whole device encryption?
    By that guy with the face in forum Windows Phone 8
    Replies: 4
    Last Post: 07-20-2013, 01:56 PM
  2. Encrypted Email on ActiveSync
    By tk-093 in forum Windows Phone 8
    Replies: 1
    Last Post: 11-28-2012, 11:06 AM
  3. Encryption question
    By cstenson in forum Windows Phone 8
    Replies: 4
    Last Post: 11-08-2012, 04:05 AM
  4. WP 7.5 and local mail encryption
    By oysteinhermansen in forum Windows Phone 7
    Replies: 2
    Last Post: 02-27-2012, 09:48 AM
  5. KIK sends password, messages without encryption
    By 1jaxstate1 in forum Windows Phone Apps
    Replies: 3
    Last Post: 06-29-2011, 02:03 PM

Posting Permissions