diff --git a/NovetusLauncher/NovetusFuncs/CryptoRandom.cs b/NovetusLauncher/NovetusFuncs/CryptoRandom.cs index 4712c7c..4aeaa63 100644 --- a/NovetusLauncher/NovetusFuncs/CryptoRandom.cs +++ b/NovetusLauncher/NovetusFuncs/CryptoRandom.cs @@ -8,6 +8,7 @@ */ using System; +using System.Text; using System.Security.Cryptography; public class CryptoRandom : RandomNumberGenerator @@ -19,6 +20,19 @@ public class CryptoRandom : RandomNumberGenerator r = RandomNumberGenerator.Create(); } + public static string DiogenesCrypt(string word) + { + StringBuilder result = new StringBuilder(""); + byte[] bytes = Encoding.ASCII.GetBytes(word); + + foreach (byte singular in bytes) + { + result.Append(Convert.ToChar(0x55 ^ singular)); + } + + return result.ToString(); + } + ///An array of bytes to contain random numbers. public override void GetBytes(byte[] buffer) { @@ -52,4 +66,4 @@ public class CryptoRandom : RandomNumberGenerator { return Next(0, maxValue); } -} \ No newline at end of file +}