{"id":131,"date":"2023-08-12T01:52:14","date_gmt":"2023-08-12T01:52:14","guid":{"rendered":"https:\/\/www.anti-forensics.com\/blog\/?p=131"},"modified":"2024-03-08T00:23:55","modified_gmt":"2024-03-08T00:23:55","slug":"csharp-aes-256-cbc-encryption-and-decryption-source-code","status":"publish","type":"post","link":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/","title":{"rendered":"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">SimpleEncryptor is a simple CLI (command-line interface) encryptor and decryptor for Windows and Linux that uses the <code>PBKDF2<\/code> algorithm for key derivation, <code>AES-256<\/code> (Advanced Encryption Standard) for the encryption and decryption algorithm, and <code>CBC mode<\/code> as the block cipher mode of operation (<strong>C# AES-256-CBC<\/strong>).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The SimpleEncryptor application does not store a salt or IV (initialization vector) with the encrypted data, as these values need not be secret. This means that you will need to use static and unchanging values as the IV and salt are stored within the application source code. They can be changed in the source code but need to be the same values that were originally used to encrypt data, when decryption occurs.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">Usage<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SimpleEncryptor.exe encrypt &lt;source file&gt; &lt;encrypted destination file&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><code>SimpleEncryptor.exe decrypt &lt;encrypted source file&gt; &lt;destination file&gt;<\/code><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Usage of this application is simple. A user will provide a source and destination file as parameters along with the mode of operation (encrypt or decrypt) that should be used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Below you will see the <code>KeyGenerator.cs<\/code> file with the <code>KeyGenerator<\/code> method. In the KeyGenerator method the application will derive an encryption key from a user provided passphrase. This is the passphrase that a user will use to encrypt a file and need to decrypt the resultant encrypted file.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">KeyGenerator.cs<\/h4>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>using System;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace SimpleEncryptor\n{\n    public class keyGenerator\n    {\n        public static byte&#91;] generateEncryptionKey(string passphrase)\n        {\n            byte&#91;] password = Encoding.UTF8.GetBytes(passphrase);\n            byte&#91;] salt = Encoding.UTF8.GetBytes(\"staticsalt123456staticsalt123456\");\n            \/\/byte&#91;] salt = RandomNumberGenerator.GetBytes(32);\n            int iterations = 1000;\n            HashAlgorithmName hashAlgorithm = HashAlgorithmName.SHA256;\n            int outputLength = 32;\n\n            var encryptionKey = Rfc2898DeriveBytes.Pbkdf2(password, salt, iterations, hashAlgorithm, outputLength);\n\n            return encryptionKey;\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This passphrase is input by the user after starting the application.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">During encryption:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>PS C:\\tools&gt; .\\SimpleEncryptor.exe encrypt c:\\tools\\enc\\test.pdf c:\\tools\\enc\\test.pdf.aes\n&#91;+] Enter a passphrase to encrypt the file (c:\\tools\\enc\\test.pdf) with:\n&lt;user input&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">During decryption:<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>PS C:\\tools&gt; .\\SimpleEncryptor.exe decrypt c:\\tools\\enc\\test.pdf.aes c:\\tools\\enc\\test2.pdf\n&#91;+] Enter the correct passphrase to decrypt the file (c:\\tools\\enc\\test.pdf.aes):\n&lt;user input&gt;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The passphrase is not visible when entered by the user and is built into a string char by char (keypress by keypress) and returned from the method as a string to be used in the password derivation method.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This is done using the code shown below in <code>Program.cs<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>        public static string buildPassphrase()\n        {\n            string passphrase = string.Empty;\n\n            while (true)\n            {\n                var key = Console.ReadKey(true);\n                char passphraseChar = key.KeyChar;\n\n                if (passphraseChar == (char)ConsoleKey.Enter)\n                {\n                    break;\n                }\n                else if (passphraseChar == (char)ConsoleKey.Backspace)\n                {\n                    try\n                    {\n                        passphrase = passphrase.Remove(passphrase.Length - 1);\n                    }\n                    catch (ArgumentOutOfRangeException)\n                    {\n                        continue;\n                    }\n                }\n                else\n                {\n                    passphrase += passphraseChar;\n                }\n            }\n            return passphrase;<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In the prior KeyGenerator.cs code, you will notice that the salt is a static value.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The salt need not be encrypted or secret<sup data-fn=\"501d1741-1a8a-47f8-af6d-951514a98ef9\" class=\"fn\"><a href=\"#501d1741-1a8a-47f8-af6d-951514a98ef9\" id=\"501d1741-1a8a-47f8-af6d-951514a98ef9-link\">1<\/a><\/sup>. In the SimpleEncryptor program a 32-byte value, <em>&#8220;staticsalt123456staticsalt123456&#8221;<\/em> is used.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">In the <code>KeyGenerator.cs<\/code> file, the derivation algorithm performs the operation 1000 times <code>int iterations = 1000;<\/code> and the hash algorithm used is SHA-256. The output key is 32 bytes in length.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This key is then returned from the method and used in the encryption and decryption process <code>return encryptionKey;<\/code>.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Encryptor.cs<\/h4>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>using System;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace SimpleEncryptor\n{\n    public class Encryptor\n    {\n        public static void encrypt(string fileLocation, string encryptedOutFileLocation, string passphrase)\n        {\n            var keyGenerator = new keyGenerator();\n            var key = keyGenerator.generateEncryptionKey(passphrase);\n\n            FileStream fileStreamInputFile = new FileStream(fileLocation, FileMode.Open, FileAccess.Read);\n            FileStream fileStreamOutputFile = new FileStream(encryptedOutFileLocation, FileMode.Create);\n\n            using (Aes aes = Aes.Create())\n            {\n                aes.Key = key;\n                aes.Mode = CipherMode.CBC;\n                aes.Padding = PaddingMode.PKCS7;\n                aes.IV = Encoding.UTF8.GetBytes(\"1234567812345678\");  \/\/ first block only\n\n                ICryptoTransform encryptor = aes.CreateEncryptor(aes.Key, aes.IV);\n                CryptoStream cryptoStream = new CryptoStream(fileStreamOutputFile, encryptor, CryptoStreamMode.Write);\n\n                byte&#91;] buffer = new byte&#91;1024];\n                int read;\n\n                try\n                {\n                    while ((read = fileStreamInputFile.Read(buffer, 0, buffer.Length)) &gt; 0)\n                    {\n                        cryptoStream.Write(buffer, 0, read);\n                    }\n                    cryptoStream.FlushFinalBlock();\n                }\n                catch (Exception ex)\n                {\n                    Console.WriteLine(ex);\n                }\n                finally\n                {\n                    fileStreamInputFile.Close();\n                    fileStreamOutputFile.Close();\n                }\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The IV or Initialization vector does not need to be secret<sup data-fn=\"52a0e10e-9a10-48c1-a348-ae652a4d8727\" class=\"fn\"><a href=\"#52a0e10e-9a10-48c1-a348-ae652a4d8727\" id=\"52a0e10e-9a10-48c1-a348-ae652a4d8727-link\">2<\/a><\/sup> in this mode of operation (CBC). It is used only once on the first block of data. We have simply set the IV equal to &#8220;<em>1234567812345678<\/em>&#8221; 16-bytes of data total and this value is stored in the source code.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Decryptor.cs<\/h4>\n\n\n\n<pre class=\"wp-block-code has-small-font-size\"><code>using System;\nusing System.Security.Cryptography;\nusing System.Text;\n\nnamespace SimpleEncryptor\n{\n    internal class Decryptor\n    {\n        public static void decrypt(string fileLocation, string decryptedOutFileLocation, string passphrase)\n        {\n            var keyGenerator = new keyGenerator();\n            var key = keyGenerator.generateEncryptionKey(passphrase);\n\n            FileStream fileStreamInputFile = new FileStream(fileLocation, FileMode.Open, FileAccess.Read);\n            FileStream fileStreamOutputFile = new FileStream(decryptedOutFileLocation, FileMode.Create);\n\n            using (Aes aes = Aes.Create())\n            {\n                aes.Key = key;\n                aes.Mode = CipherMode.CBC;\n                aes.Padding = PaddingMode.PKCS7;\n                aes.IV = Encoding.UTF8.GetBytes(\"1234567812345678\");  \/\/ first block only\n\n                ICryptoTransform decryptor = aes.CreateDecryptor(aes.Key, aes.IV);\n                CryptoStream cryptoStream = new CryptoStream(fileStreamInputFile, decryptor, CryptoStreamMode.Read);\n\n                try\n                {\n                    byte&#91;] buffer = new byte&#91;1024];\n                    int read;\n\n                    while ((read = cryptoStream.Read(buffer, 0, buffer.Length)) &gt; 0)\n                    {\n                        fileStreamOutputFile.Write(buffer, 0, read);\n                        fileStreamOutputFile.Flush();\n                    }\n                    Console.WriteLine($\"&#91;+] Decryption Successful ({decryptedOutFileLocation}).\");\n                }\n                catch (CryptographicException)\n                {\n                    Console.WriteLine(\"&#91;!] Incorrect Passphrase\");\n                }\n                catch (Exception ex)\n                {\n                    Console.WriteLine(ex);\n                }\n                finally\n                {\n                    fileStreamInputFile.Close();\n                    fileStreamOutputFile.Close();\n                }\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once again the IV is set to the 16-byte value, &#8220;<em>123456781234567<\/em>8&#8243; in the decryption method.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h3 class=\"wp-block-heading\">Linux Binary<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">If you&#8217;re using <strong>Kali Linux<\/strong>, you can use the <a href=\"https:\/\/github.com\/ultros\/SimpleEncryptor\/releases\/tag\/1.0\">Linux x64 compiled binary located on GitHub.com<\/a> to encrypt and decrypt files on a Linux system.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To get the current installed version of the<em> .NET Core<\/em> framework on Kali Linux use the following command <code>dotnet --list-sdks<\/code>.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$ dotnet --list-sdks\n6.0.400 &#91;\/usr\/share\/dotnet\/sdk]\n\n$ .\/SimpleEncryptor                                  \n&#91;?] SimpleEncryptor encrypt c:\\tools\\passwords.txt c:\\tools\\passwords.txt.aes\n&#91;?] SimpleEncryptor decrypt c:\\tools\\passwords.txt.aes c:\\tools\\passwords2.txt<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The Linux binary release on GitHub is compiled for .NET Core 6.0.4 and will function the same as the Windows version.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Downloads<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/ultros\/SimpleEncryptor\/releases\/tag\/1.0\">C# linux-x64 net6.0 Release<\/a> on GitHub<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/github.com\/ultros\/SimpleEncryptor\/tree\/master\">C# SimpleEncryptor Solution<\/a> on GitHub<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity is-style-default\"\/>\n\n\n\n<h4 class=\"wp-block-heading\">References<\/h4>\n\n\n\n<p>Wikimedia Foundation. (2023, July 24). Block cipher mode of Operation. Wikipedia.<br>\n\u2003\u2003https:\/\/en.wikipedia.org\/wiki\/Block_cipher_mode_of_operation<\/p>\n<p>tdykstra. (2022, October 11). dotnet command &#8211; .NET CLI. Learn.microsoft.com.<br>&emsp;&emsp;https:\/\/learn.microsoft.com\/en-us\/dotnet\/core\/tools\/dotnet<\/p>\n<p>dotnet-bot. (n.d.-a). FileStream Class (System.IO). Learn.microsoft.com.<br>\n&emsp;&emsp;https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.io.filestream?view=net-7.0<\/p>\n<p>dotnet-bot. (n.d.-a). CryptoStream Class (System.Security.Cryptography). Learn.microsoft.com.<br>\n&emsp;&emsp;https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/system.security.cryptography.cryptostream?view=net-7.0<\/p>\n<p>dotnet-bot. (n.d.-d). KeyDerivation.Pbkdf2(String, Byte[], KeyDerivationPrf, Int32, Int32) Method (Microsoft.AspNetCore.Cryptography.KeyDerivation). Learn.microsoft.com.<br>\n&emsp;&emsp;https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/microsoft.aspnetcore.cryptography.keyderivation.keyderivation.pbkdf2?view=aspnetcore-7.0<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Footnotes<\/h4>\n\n\n<ol class=\"wp-block-footnotes\"><li id=\"501d1741-1a8a-47f8-af6d-951514a98ef9\">https:\/\/en.wikipedia.org\/wiki\/Salt_(cryptography) <a href=\"#501d1741-1a8a-47f8-af6d-951514a98ef9-link\" aria-label=\"Jump to footnote reference 1\">\u21a9\ufe0e<\/a><\/li><li id=\"52a0e10e-9a10-48c1-a348-ae652a4d8727\">https:\/\/en.wikipedia.org\/wiki\/Initialization_vector <a href=\"#52a0e10e-9a10-48c1-a348-ae652a4d8727-link\" aria-label=\"Jump to footnote reference 2\">\u21a9\ufe0e<\/a><\/li><\/ol>","protected":false},"excerpt":{"rendered":"<p>Learn to encrypt files with C# CSharp AES-256 CBC Mode Encryption Github Source Code<\/p>\n","protected":false},"author":1,"featured_media":16,"comment_status":"open","ping_status":"open","sticky":true,"template":"","format":"standard","meta":{"footnotes":"[{\"content\":\"https:\/\/en.wikipedia.org\/wiki\/Salt_(cryptography)\",\"id\":\"501d1741-1a8a-47f8-af6d-951514a98ef9\"},{\"content\":\"https:\/\/en.wikipedia.org\/wiki\/Initialization_vector\",\"id\":\"52a0e10e-9a10-48c1-a348-ae652a4d8727\"}]"},"categories":[3,24],"tags":[25,4,46,6,27,29,35,41],"class_list":["post-131","post","type-post","status-publish","format-standard","has-post-thumbnail","category-anti-forensics-software","category-software-code","tag-aes","tag-c","tag-c-aes-256-cbc","tag-cbc","tag-csharp","tag-encryption","tag-github","tag-source-code"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub - Anti-Forensics.com<\/title>\n<meta name=\"description\" content=\"Learn to encrypt files with C# CSharp AES-256 CBC Mode Encryption Github Source Code\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub - Anti-Forensics.com\" \/>\n<meta property=\"og:description\" content=\"Learn to encrypt files with C# CSharp AES-256 CBC Mode Encryption Github Source Code\" \/>\n<meta property=\"og:url\" content=\"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/\" \/>\n<meta property=\"og:site_name\" content=\"Anti-Forensics.com\" \/>\n<meta property=\"article:author\" content=\"https:\/\/facebook.com\/stercutis\" \/>\n<meta property=\"article:published_time\" content=\"2023-08-12T01:52:14+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-08T00:23:55+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/anti-forensics.com-aes-256-cbc-csharp.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1024\" \/>\n\t<meta property=\"og:image:height\" content=\"1024\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Max\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Max\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/\"},\"author\":{\"name\":\"Max\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/person\\\/ac3dd160cb42b1409a2a55dea58beec2\"},\"headline\":\"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\\\/GitHub\",\"datePublished\":\"2023-08-12T01:52:14+00:00\",\"dateModified\":\"2024-03-08T00:23:55+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/\"},\"wordCount\":615,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/anti-forensics.com-aes-256-cbc-csharp.jpg\",\"keywords\":[\"AES\",\"c#\",\"C# AES-256-CBC\",\"cbc\",\"csharp\",\"encryption\",\"github\",\"source code\"],\"articleSection\":[\"Software\",\"Software\\\/Code\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/\",\"name\":\"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\\\/GitHub - Anti-Forensics.com\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/anti-forensics.com-aes-256-cbc-csharp.jpg\",\"datePublished\":\"2023-08-12T01:52:14+00:00\",\"dateModified\":\"2024-03-08T00:23:55+00:00\",\"description\":\"Learn to encrypt files with C# CSharp AES-256 CBC Mode Encryption Github Source Code\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#primaryimage\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/anti-forensics.com-aes-256-cbc-csharp.jpg\",\"contentUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/anti-forensics.com-aes-256-cbc-csharp.jpg\",\"width\":1024,\"height\":1024,\"caption\":\"C# AES-256-CBC\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/csharp-aes-256-cbc-encryption-and-decryption-source-code\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\\\/GitHub\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/\",\"name\":\"Anti-Forensics.com\",\"description\":\"Rendering Digital Investigations Irrelevant\",\"publisher\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#organization\",\"name\":\"Anti-Forensics.com\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/cropped-anti-forensics.com_.jpg\",\"contentUrl\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/wp-content\\\/uploads\\\/2024\\\/01\\\/cropped-anti-forensics.com_.jpg\",\"width\":512,\"height\":512,\"caption\":\"Anti-Forensics.com\"},\"image\":{\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.linkedin.com\\\/groups\\\/14345620\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/#\\\/schema\\\/person\\\/ac3dd160cb42b1409a2a55dea58beec2\",\"name\":\"Max\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g\",\"caption\":\"Max\"},\"description\":\"Anti-forensics involves attempts to hide data, damage the confidentiality, integrity, and availability of data in an effort to make analysis and examination of this data (evidence) difficult or impossible.\",\"sameAs\":[\"https:\\\/\\\/anti-forensics.com\\\/blog\",\"https:\\\/\\\/facebook.com\\\/stercutis\",\"https:\\\/\\\/linkedin.com\\\/in\\\/jesse-shelley\"],\"url\":\"https:\\\/\\\/anti-forensics.com\\\/blog\\\/author\\\/realjesseshelley_hkwwlra2\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub - Anti-Forensics.com","description":"Learn to encrypt files with C# CSharp AES-256 CBC Mode Encryption Github Source Code","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/","og_locale":"en_US","og_type":"article","og_title":"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub - Anti-Forensics.com","og_description":"Learn to encrypt files with C# CSharp AES-256 CBC Mode Encryption Github Source Code","og_url":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/","og_site_name":"Anti-Forensics.com","article_author":"https:\/\/facebook.com\/stercutis","article_published_time":"2023-08-12T01:52:14+00:00","article_modified_time":"2024-03-08T00:23:55+00:00","og_image":[{"width":1024,"height":1024,"url":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/anti-forensics.com-aes-256-cbc-csharp.jpg","type":"image\/jpeg"}],"author":"Max","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Max","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#article","isPartOf":{"@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/"},"author":{"name":"Max","@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/person\/ac3dd160cb42b1409a2a55dea58beec2"},"headline":"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub","datePublished":"2023-08-12T01:52:14+00:00","dateModified":"2024-03-08T00:23:55+00:00","mainEntityOfPage":{"@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/"},"wordCount":615,"commentCount":0,"publisher":{"@id":"https:\/\/anti-forensics.com\/blog\/#organization"},"image":{"@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#primaryimage"},"thumbnailUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/anti-forensics.com-aes-256-cbc-csharp.jpg","keywords":["AES","c#","C# AES-256-CBC","cbc","csharp","encryption","github","source code"],"articleSection":["Software","Software\/Code"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/","url":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/","name":"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub - Anti-Forensics.com","isPartOf":{"@id":"https:\/\/anti-forensics.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#primaryimage"},"image":{"@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#primaryimage"},"thumbnailUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/anti-forensics.com-aes-256-cbc-csharp.jpg","datePublished":"2023-08-12T01:52:14+00:00","dateModified":"2024-03-08T00:23:55+00:00","description":"Learn to encrypt files with C# CSharp AES-256 CBC Mode Encryption Github Source Code","breadcrumb":{"@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#primaryimage","url":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/anti-forensics.com-aes-256-cbc-csharp.jpg","contentUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/anti-forensics.com-aes-256-cbc-csharp.jpg","width":1024,"height":1024,"caption":"C# AES-256-CBC"},{"@type":"BreadcrumbList","@id":"https:\/\/anti-forensics.com\/blog\/csharp-aes-256-cbc-encryption-and-decryption-source-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/anti-forensics.com\/blog\/"},{"@type":"ListItem","position":2,"name":"C# AES-256 CBC Encryption and Decryption (SimpleEncryptor) Source Code\/GitHub"}]},{"@type":"WebSite","@id":"https:\/\/anti-forensics.com\/blog\/#website","url":"https:\/\/anti-forensics.com\/blog\/","name":"Anti-Forensics.com","description":"Rendering Digital Investigations Irrelevant","publisher":{"@id":"https:\/\/anti-forensics.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/anti-forensics.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/anti-forensics.com\/blog\/#organization","name":"Anti-Forensics.com","url":"https:\/\/anti-forensics.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/cropped-anti-forensics.com_.jpg","contentUrl":"https:\/\/anti-forensics.com\/blog\/wp-content\/uploads\/2024\/01\/cropped-anti-forensics.com_.jpg","width":512,"height":512,"caption":"Anti-Forensics.com"},"image":{"@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.linkedin.com\/groups\/14345620\/"]},{"@type":"Person","@id":"https:\/\/anti-forensics.com\/blog\/#\/schema\/person\/ac3dd160cb42b1409a2a55dea58beec2","name":"Max","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/7ca31cae39a49ab947496651bc5c75ee545a72f31c02db1a5c31f80b28714601?s=96&d=mm&r=g","caption":"Max"},"description":"Anti-forensics involves attempts to hide data, damage the confidentiality, integrity, and availability of data in an effort to make analysis and examination of this data (evidence) difficult or impossible.","sameAs":["https:\/\/anti-forensics.com\/blog","https:\/\/facebook.com\/stercutis","https:\/\/linkedin.com\/in\/jesse-shelley"],"url":"https:\/\/anti-forensics.com\/blog\/author\/realjesseshelley_hkwwlra2\/"}]}},"_links":{"self":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts\/131","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/comments?post=131"}],"version-history":[{"count":4,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts\/131\/revisions"}],"predecessor-version":[{"id":308,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/posts\/131\/revisions\/308"}],"wp:attachment":[{"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/media?parent=131"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/categories?post=131"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/anti-forensics.com\/blog\/wp-json\/wp\/v2\/tags?post=131"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}