2024-04-18 07:12:10 +00:00
|
|
|
|
namespace SCHALE.Common.Crypto
|
|
|
|
|
{
|
|
|
|
|
public static class XOR
|
|
|
|
|
{
|
2024-04-21 00:21:57 +00:00
|
|
|
|
public static void Crypt(byte[] bytes, byte[] key, uint offset = 0)
|
2024-04-18 07:12:10 +00:00
|
|
|
|
{
|
|
|
|
|
while (offset < bytes.Length)
|
|
|
|
|
{
|
2024-04-21 00:21:57 +00:00
|
|
|
|
bytes[offset] ^= key[offset % key.Length];
|
|
|
|
|
offset++;
|
2024-04-18 07:12:10 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|