134
{
//columnHeader1.ListView.Items.Add(f.SafeFileName);
//columnHeader2.ListView.Items.Add(File.GetAttributes(f.FileName).ToString());
//columnHeader3.ListView.Items.Add(File.GetCreationTime(f.FileName).ToString());
//columnHeader4.LView.Items.Add(f.FileName);
byte[] hash =
ElementalEncryptor.getHashSha256(Properties.Settings.Default.Password);
var sevenItems = new byte[] { 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20,
0x20, 0x20, 0x20
,0x20,0x20,0x20,0x20,0x20,0x20};
try
{
byte[] enc =
ElementalEncryptor.encryptStream(File.ReadAllBytes(f.FileName), hash,
sevenItems);
File.WriteAllBytes(workdir + System.IO.Path.GetFileName(f.FileName)
+ ".tth", enc);
}
catch (Exception ex) { MessageBox.Show(ex.Message); return; }
// ElementalEncryptor.EncryptFile(f.FileName, workdir +
System.IO.Path.GetFileName(f.FileName));
// string[] row = { f.SafeFileName,
workdir+System.IO.Path.GetFileName(f.FileName) };
// ListViewItem i = new ListViewItem(row);
// listView1.Items.Add(i);
//files.Add(row);
MessageBox.Show(workdir + System.IO.Path.GetFileName(f.FileName));
refreshFileList(textBox1.Text);
// listView1.Column
}
}
private void извлечьToolStripMenuItem_Click(object sender, EventArgs e)
{ Array.Copy(plain, returnval, count);
return returnval;
}
public static void EncryptFile(string input, string output)
{
byte[] bytes = File.ReadAllBytes(input);
byte temp;
Array.Reverse(bytes, 0, bytes.Length);
File.WriteAllBytes(output, bytes);
}
public static void DecryptFile(string input, string output)
{
byte[] bytes = File.ReadAllBytes(input);
byte temp;