LethalCompany/Lethal Company/ExportedProject/Assets/Plugins/Assembly-CSharp-firstpass/ES3Internal/EncryptionAlgorithm.cs
2023-12-22 18:30:10 -05:00

25 lines
695 B
C#

using System.IO;
namespace ES3Internal
{
public abstract class EncryptionAlgorithm
{
public abstract byte[] Encrypt(byte[] bytes, string password, int bufferSize);
public abstract byte[] Decrypt(byte[] bytes, string password, int bufferSize);
public abstract void Encrypt(Stream input, Stream output, string password, int bufferSize);
public abstract void Decrypt(Stream input, Stream output, string password, int bufferSize);
protected static void CopyStream(Stream input, Stream output, int bufferSize)
{
byte[] buffer = new byte[bufferSize];
int count;
while ((count = input.Read(buffer, 0, bufferSize)) > 0)
{
output.Write(buffer, 0, count);
}
}
}
}