Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Cryptography not available on target framework

Discussion in 'Windows' started by WheresMommy, Sep 15, 2013.

  1. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    Hi there,

    currently trying out windows phone 8 development with Unity. Got a game which is storing the pref keys with an asset from the unity store. But when trying to export the game, ill get this error. Does anyone have a workaround for this? It is using the md5 hash:

    Code (csharp):
    1. public static string Md5Sum (string strToEncrypt)
    2.     {
    3.         System.Text.UTF8Encoding ue = new System.Text.UTF8Encoding ();
    4.         byte[] bytes = ue.GetBytes (strToEncrypt);
    5.  
    6.         // encrypt bytes
    7.         System.Security.Cryptography.MD5CryptoServiceProvider md5 = new System.Security.Cryptography.MD5CryptoServiceProvider ();
    8.         byte[] hashBytes = md5.ComputeHash (bytes);
    9.  
    10.         // Convert the encrypted bytes back to a string (base 16)
    11.         string hashString = "";
    12.  
    13.         for (int i = 0; i < hashBytes.Length; i++) {
    14.             hashString += System.Convert.ToString (hashBytes [i], 16).PadLeft (2, '0');
    15.         }
    16.  
    17.         return hashString.PadLeft (32, '0');
    18.     }
     
  2. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    Noone with any solution here? *bump*
     
  3. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,526
  4. WheresMommy

    WheresMommy

    Joined:
    Oct 4, 2012
    Posts:
    890
    Yeah, I know what it means, but I am not into that hash thing like maybe some other users are and already worked around saving playerprefs entcrypted with another format.