Example #1
0
 private static byte[] GetKeyfileBytes(byte[] passwordBytes)
 {
     if (!string.IsNullOrEmpty(Globals.KeyfilePath))
     {
         byte[] keyfileBytes = Keyfiles.ReadKeyfile(Globals.KeyfilePath);
         if (keyfileBytes != null)
         {
             MemoryEncryption.DecryptByteArray(ref passwordBytes);
             // Combine password and keyfile bytes
             passwordBytes = HashingAlgorithms.Blake2(passwordBytes, keyfileBytes);
             MemoryEncryption.EncryptByteArray(ref passwordBytes);
             Utilities.ZeroArray(keyfileBytes);
         }
     }
     return(passwordBytes);
 }
Example #2
0
 private static byte[] KeyfileAsPassword()
 {
     // If only a keyfile was selected, use the keyfile bytes as the password
     byte[] passwordBytes = Keyfiles.ReadKeyfile(Globals.KeyfilePath);
     return(HashPasswordBytes(passwordBytes));
 }
Example #3
0
        private void TsmiSelectKeyfile_Click(object sender, EventArgs e)
        {
            bool keyfileSelected = Keyfiles.SelectKeyfile();

            KeyfileSelected(keyfileSelected);
        }
Example #4
0
        private void TsmiCreateKeyFile_Click(object sender, EventArgs e)
        {
            bool keyfileGenerated = Keyfiles.CreateKeyfile();

            KeyfileSelected(keyfileGenerated);
        }