diff options
| author | MichaelTheShifter <[email protected]> | 2016-07-05 08:41:13 -0400 |
|---|---|---|
| committer | MichaelTheShifter <[email protected]> | 2016-07-05 08:41:13 -0400 |
| commit | a0b001b25f001d1df767987528980704d3d40347 (patch) | |
| tree | 1ecffeff1107f263d3f3914642398d7f27d49cd9 /source/WindowsFormsApplication1/API.cs | |
| parent | b5a5e0eb8a29e7eb858b6db6f8f7a60a2b2ae90c (diff) | |
| download | shiftos-c-_theultimatehacker-a0b001b25f001d1df767987528980704d3d40347.tar.gz shiftos-c-_theultimatehacker-a0b001b25f001d1df767987528980704d3d40347.tar.bz2 shiftos-c-_theultimatehacker-a0b001b25f001d1df767987528980704d3d40347.zip | |
Change Lua encryption key to be the old one.
Diffstat (limited to 'source/WindowsFormsApplication1/API.cs')
| -rw-r--r-- | source/WindowsFormsApplication1/API.cs | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/source/WindowsFormsApplication1/API.cs b/source/WindowsFormsApplication1/API.cs index 9c8c69c..f952a18 100644 --- a/source/WindowsFormsApplication1/API.cs +++ b/source/WindowsFormsApplication1/API.cs @@ -474,6 +474,33 @@ namespace ShiftOS } } + public static string Encrypt_old(string plainText) + { + byte[] plainTextBytes = Encoding.UTF8.GetBytes(plainText); + using (PasswordDeriveBytes password = new PasswordDeriveBytes(passPhrase, null)) + { + byte[] keyBytes = password.GetBytes(keysize / 8); + using (RijndaelManaged symmetricKey = new RijndaelManaged()) + { + symmetricKey.Mode = CipherMode.CBC; + using (ICryptoTransform encryptor = symmetricKey.CreateEncryptor(keyBytes, initVectorBytes)) + { + using (MemoryStream memoryStream = new MemoryStream()) + { + using (CryptoStream cryptoStream = new CryptoStream(memoryStream, encryptor, CryptoStreamMode.Write)) + { + cryptoStream.Write(plainTextBytes, 0, plainTextBytes.Length); + cryptoStream.FlushFinalBlock(); + byte[] cipherTextBytes = memoryStream.ToArray(); + return Convert.ToBase64String(cipherTextBytes); + } + } + } + } + } + } + + /// <summary> /// Decrypts an encrypted string. /// </summary> |
