Example #1
0
 /// <summary>
 /// Encryptes a dictionary to a byte array
 /// </summary>
 /// <param name="pVal">Dictionary to be encrypted</param>
 /// <returns></returns>
 public byte[] EncryptKV(Dictionary <string, string> pVal)
 {
     try
     {
         string t = CU.SerializeObjectToJSONString(pVal);
         return(Encrypt(CU.CUnicodeString2Array(t), MySecrets?.GetAK(), MySecrets?.GetAI()));
     }
     catch (Exception)
     {
         TheBaseAssets.MySYSLOG?.WriteToLog(TSM.L(eDEBUG_LEVELS.OFF) ? null : new TSM("TheCommonUtils", $"Error during KV encrypt...", eMsgLevel.l1_Error), 5016);
         return(null);
     }
 }
Example #2
0
 /// <summary>
 /// Encryptes a dictionary to a byte array
 /// </summary>
 /// <param name="pVal">Dictionary to be encrypted</param>
 /// <returns></returns>
 public byte[] EncryptKV(Dictionary <string, string> pVal)
 {
     try
     {
         string t      = CU.SerializeObjectToJSONString(pVal);
         var    tFinal = $"{CU.GetRandomUInt(0, 10000)}:{t.Length}@" + t;
         return(Encrypt(CU.CUnicodeString2Array(tFinal), MySecrets?.GetAK(), MySecrets?.GetAI()));
     }
     catch (Exception)
     {
         MySYSLOG?.WriteToLog(0, 5016, "ICDECrypto", $"Error during KV encrypt...", eMsgLevel.l1_Error);
         return(null);
     }
 }