public void EncryptFile()
{
OpenFileDialog dialog = new OpenFileDialog();
dialog.Filter = "JPEG Files (*.jpeg)|*.jpeg|PNG Files (*.png)|*.png|All files (*.*)|*.*";
dialog.InitialDirectory = @"C:\";
dialog.Title = "Please select an image file to encrypt.";
if (dialog.ShowDialog() == DialogResult.OK)
{
byte[] ImageBytes = File.ReadAllBytes(dialog.FileName);
foreach (byte X in ImageBytes)
{
//How can I take byte "X" and add a numerical value to it?
}
}
}
So, I'm trying to encrypt an image file by just converting it to byte[] array and then adding a numerical value to each byte.
How can I add a numerical value to a byte?