11

today i installed the new windows phone 8 sdk (w8phone sdk)... tried to include some of my base classes from windows 8 apps... same core they say... but whoops?

no Windows.Security.Cryptography?

I used the SymmetricKeyAlgorithmProvider for end-to-end encryption of serialized data with WCF Services. (http://msdn.microsoft.com/en-us/library/windows/apps/xaml/br241537.aspx)

Seems using .NET Framework Encryption is quite proprietary to the platforms/devices.

Anyone some advises for same functionality on Windows 8 Phone?

Thanks.

EDIT/UPDATE

I solved the problem by porting http://www.bouncycastle.org/ to separate Windows 8 and Windows Phone 8 Libs and a slight changed version of the little BC Engine from here: Encrypt/Decrypt using Bouncy Castle in C#

enter image description here

Community
  • 1
  • 1
oneff
  • 121
  • 1
  • 8

1 Answers1

10

Windows.Security.Cryptography is a WinRT API. Windows Phone 8 still being mostly Silverlight uses the APIs from System.Security.Cryptography, which does not include the SymmetricKeyAlgorithmProvider.

You can still use the AesManaged API on Windows Phone, which may, or may not, be enough for your purpose.

Windows.Security.Cryptography is most likely just the x86 COM abstraction of the Microsoft cryptolib, which is the same as most of System.Security.Cryptography on .NET 3.5-4.0

Claus Jørgensen
  • 25,882
  • 9
  • 87
  • 150
  • 1
    Thanks for this voluminous answer. Sure with WP7 compatibility the can't easy go to WinRT API even with the Win8 Core under the hood. But I want also have the same Lib on Server Side with .NET 4.5, not having 3 different implementations for the same encryption purpose. So I stick to my approach having bouncycastle.org compiled for each plattform/device using same methods and signatures. – oneff Nov 03 '12 at 09:42
  • And that's indeed a good solution. Optionally, with WP8 now supporting unmanaged code, it should be possible to have a unmanaged implementation of the cryptography algorithms, and such improve performance quite a bit, compared to the fully managed implementations. But it'll probably be some months before we see such projects available on Github et. al. – Claus Jørgensen Nov 03 '12 at 12:51
  • AesManaged seems to in System.Security.Cryptography namespace. source: https://msdn.microsoft.com/en-us/library/system.security.cryptography.aesmanaged.aspx – Mostafiz Rahman Jun 14 '15 at 13:53