public static bool stegoEncryption(string txt, string fileName, string newFileName, out byte[] iv, out byte[] key, int[] stegoKey, string[] compressKey, out List <string> table) { Aes myAes = Aes.Create(); iv = myAes.IV; key = myAes.Key; byte[] encrypted = AESEncypt.EncryptStringToBytes_Aes(txt, myAes.Key, myAes.IV); string encString = Convert.ToBase64String(encrypted); List <bool> compMsg = groupCompress(encString, compressKey, out table); bool ok = stegoChar(encString, fileName, newFileName, stegoKey, compMsg); return(ok); }
public static string stegoEncryptionRet(string fileName, byte[] iv, byte[] key, int[] stegoKey, string[] compressKey, List <string> table) { Aes myAes = Aes.Create(); myAes.IV = iv; myAes.Key = key; string dec = stegoCharRet(fileName, stegoKey, compressKey, table); // dec = dec.Remove(dec.Length - 1, 1); byte[] bytes = Convert.FromBase64String(dec); string decrypted = AESEncypt.DecryptStringFromBytes_Aes(bytes, key, iv); return(decrypted); }