Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can I encrypt a string in a portable class library without using PCLContrib?

I am building a portable library targeting Windows 8.1. I need to encrypt a password to send it across an http connection. The problem is that System.Security.Cryptography is not available in portable libraries.

The only solution that I've been able to find is the PCL Contrib, but it seems far too bulky to add that to my project. I was also getting some runtime exceptions in PCL Contrib that I couldn't resolve.

I am sure that there has to be a simple solution out there, but I haven't been able to find any that doesn't use System.Security.Cryptography. Does anyone know of a simple to use encryption that can be used in a portable library?

like image 580
brent.esh Avatar asked Jun 13 '14 12:06

brent.esh


1 Answers

Use PCLCrypto. It offers WinRT-like APIs for cryptography, but it works on all the modern platforms.

like image 67
Andrew Arnott Avatar answered Oct 07 '22 15:10

Andrew Arnott