I am working on decrypting a string (read from a database) in PCL for Windows Phone 8. Below is a scenerio:
A solution that has 3 projects, a Windows UI , a Windows Phone portable class library, and a class library .
The class library project has a StringDecryption class that contains the code below:
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;
namespace DecryptString
{
public class StringDecryption
{
public string Decryption(string encryptedTExt)
{
var protectedText = this.ReadEncryptedData(encryptedTExt);
var textByte = ProtectedData.Unprotect(protectedText, null, DataProtectionScope.CurrentUser);
return Encoding.UTF8.GetString(textByte, 0, textByte.Length);
}
public byte[] ReadEncryptedData(string text)
{
var reader = new StreamReader(text).BaseStream;
var textArray = new byte[reader.Length];
reader.Read(textArray, 0, textArray.Length);
reader.Close();
return textArray;
}
public string Getname()
{
return "MyName";
}
}
}
dll System.IO.FileNotFoundException, , Getname. . "System.Security, Version = 4.0.0.0, Culture = neutral, PublicKeyToken = b03f5f7f11d50a3a" . .
PCL?
.