示例#1
0
        public static string GetDiaryText(byte[] cipherText)
        {
            byte[] keyMaterial = Convert.FromBase64String(kmKey);

            return(CryptoUtilities.ByteArrayToString(
                       CryptoUtilities.Decrypt(cipherText, keyMaterial)));
        }
        // Decryption of goal description - coming from SQLite database
        string GetGoalText(byte[] cipherText)
        {
            Account account = accountManager.CheckForAccount();

            if (!account.Properties.TryGetValue("keymaterial", out string keyString))
            {
                return(String.Empty);
            }

            byte[] keyMaterial = Convert.FromBase64String(keyString);

            return(CryptoUtilities.ByteArrayToString(CryptoUtilities.Decrypt(cipherText, keyMaterial)));
        }
        string GetDiaryText(byte[] cipherText)
        {
            string keyString;

            if (!account.Properties.TryGetValue(kmKey, out keyString))
            {
                return(string.Empty);
            }

            byte[] keyMaterial = Convert.FromBase64String(keyString);

            return(CryptoUtilities.ByteArrayToString(CryptoUtilities.Decrypt(cipherText, keyMaterial)));
        }
示例#4
0
 string GetDiaryText(byte[] cipherText)
 {
     //TODO
     return(CryptoUtilities.ByteArrayToString(cipherText));
 }