Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static string IV = "1a1a1a1a1a1a1a1a";
- public static string Key = "1a1a1a1a1a1a1a1a1a1a1a1a1a1a1a13";
- public static string Encrypt(string decrypted)
- {
- byte[] textbytes = ASCIIEncoding.ASCII.GetBytes(decrypted);
- AesCryptoServiceProvider endec = new AesCryptoServiceProvider();
- endec.BlockSize = 128;
- endec.KeySize = 256;
- endec.IV = ASCIIEncoding.ASCII.GetBytes(IV);
- endec.Key = ASCIIEncoding.ASCII.GetBytes(Key);
- endec.Padding = PaddingMode.PKCS7;
- endec.Mode = CipherMode.CBC;
- ICryptoTransform icrypt = endec.CreateEncryptor(endec.Key, endec.IV);
- byte[] enc = icrypt.TransformFinalBlock(textbytes, 0, textbytes.Length);
- icrypt.Dispose();
- return Convert.ToBase64String(enc);
- }
- public static string Decrypted(string encrypted)
- {
- byte[] textbytes = Convert.FromBase64String(encrypted);
- AesCryptoServiceProvider endec = new AesCryptoServiceProvider();
- endec.BlockSize = 128;
- endec.KeySize = 256;
- endec.IV = ASCIIEncoding.ASCII.GetBytes(IV);
- endec.Key = ASCIIEncoding.ASCII.GetBytes(Key);
- endec.Padding = PaddingMode.PKCS7;
- endec.Mode = CipherMode.CBC;
- ICryptoTransform icrypt = endec.CreateDecryptor(endec.Key, endec.IV);
- byte[] enc = icrypt.TransformFinalBlock(textbytes, 0, textbytes.Length);
- icrypt.Dispose();
- return System.Text.ASCIIEncoding.ASCII.GetString(enc);
- }
- var sw = new StreamWriter(".\\RedExploit-Data\\RedExploit.Key");
- string enctxt = Encrypt(".\\RedExploit - Data\\RedExploit.Key");
- sw.WriteLine(enctxt);
- sw.Close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement