Example #1
0
        static public void AssemblyImage(string pathToMain)
        {
            if (!File.Exists(pathToMain))
            {
                throw new FileNotFoundException();
            }
            if (new FileInfo(pathToMain).Length == 0)
            {
                throw new Exception("File is empty!");
            }

            string[] textFromFile     = File.ReadAllLines(pathToMain);
            string   stringImageCrypt = ReadAndSaveFile.ReadFile(pathToMain);


            int ocunt    = stringImageCrypt.Length;
            var encoding = new System.Text.UTF8Encoding();

            string[] tempAry   = stringImageCrypt.Split('-');
            byte[]   byteImage = new byte[tempAry.Length];
            for (int i = 0; i < tempAry.Length; i++)
            {
                byteImage[i] = Convert.ToByte(tempAry[i], 16);
            }

            string stringImage = Cryptograchia.FromAes256(byteImage);

            WorkWirhImages.GetImageFromByte(stringImage);
        }
Example #2
0
        static private void SeparateImage(string pathToImage)
        {
            int    countPart   = 3;
            string stringImage = WorkWirhImages.GetStringByteImage(pathToImage);

            byte[] byteImage        = Cryptograchia.ToAes256(stringImage);
            string stringImageCrypt = BitConverter.ToString(byteImage);

            int[]    delimeterToPart = WorkWirhImages.RandomDelimeter(stringImageCrypt, countPart);
            string[] folderToSave    = WorkWithFolder.DistributeFileToFolder(countPart);
            ReadAndSaveFile.SaveFile(delimeterToPart, stringImageCrypt, folderToSave);
        }