[英]Get the distorted/encrypted image from encrypted data bytes of an image
我已經使用簡化的DES加密了圖像文件(.jpeg / .png)的數據字節。 但是,加密后,圖像文件將無法重新轉換為圖像,因為它丟失了其原始文件結構。 有什么方法可以使用這些加密的數據字節轉換為圖像文件? 這是我的C#代碼的一瞥:
Console.WriteLine("Please enter the RGB/GRAY/BINARY image path: ");
string path = Console.ReadLine();
byte []arrayPT = Conversion.Convert.ImageToBinary(path); // Get the binary data
byte []arrayCT = new byte[arrayPT.Length];
int i = 0;
foreach (byte element in arrayPT)
{
arrayCT[i] = ob.Encrypt(element);
/* I want to use the contents of the arrayCT[] and convert to an image */
Console.Write("{0}", arrayCT[i]);
i++;
}
使用當前的方法,您正在將圖像標題和內容一起加密,它將不再被視為圖像。
如果您不需要隱藏它是圖像也不是寬度×高度的事實,那么我將采取以下方法:
檢查Bitmapdata ,了解有效處理圖像字節的方法。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.