Exemple #1
0
 public static void PerformBenchmark(int delayPerFile)
 {
     Console.WriteLine();
     RunBenchmark(delayPerFile);
     KryptorSettings.SaveSettings();
     // Deallocate RAM for Argon2
     GC.Collect();
     Console.WriteLine();
     Console.WriteLine($"Argon2 will use a memory size of {Invariant.ToString(Globals.MemorySize / Constants.Mebibyte)} MiB. This value can be changed in the settings.");
 }
Exemple #2
0
 public static void EncryptByteArray(ref byte[] byteArray)
 {
     try
     {
         if (Globals.MemoryEncryption == true && byteArray != null)
         {
             byteArray = SealedPublicKeyBox.Create(byteArray, _keyPair.PublicKey);
         }
     }
     catch (Exception ex) when(ExceptionFilters.MemoryEncryptionExceptions(ex))
     {
         Globals.MemoryEncryption = false;
         KryptorSettings.SaveSettings();
         Logging.LogException(ex.ToString(), Logging.Severity.Bug);
         DisplayMessage.Error(ex.GetType().Name, "Memory encryption has been disabled due to an exception. This is a bug - please report it.");
     }
 }