public static byte[] Encrypt(byte[] input) { int len = input.Length; byte[] output = new byte[len]; NativeEncryption.PWEncrypt(input, output, len); return output; }
public byte[] Encrypt(byte[] input) { int len = input.Length; byte[] output = new byte[len]; NativeEncryption.TwofishEncrypt(ref obj, input, output, len); return(output); }
public byte[] Encrypt(byte[] data) { int len = data.Length; byte[] encryptedData = new byte[len]; NativeEncryption.LoginCryptEncrypt(ref obj, data, encryptedData, len); return(encryptedData); }
public byte[] Decompress(byte[] src, out int dest_size) { int len = src.Length; byte[] dest = new byte[NativeEncryption.MIN_DECBUF_SIZE(len)]; NativeEncryption.Decompress(dest, src, out dest_size, ref len, ref obj); return(dest); }
/// <summary> /// Initializes the new object. /// </summary> /// <param name="seed">Encryption seed in Little Endian!!</param> /// <param name="key1"></param> /// <param name="key2"></param> public LoginEncryption(uint seed, uint key1, uint key2) { obj = new LoginCryptObj(); obj.pseed = seed; obj.k1 = key1; obj.k2 = key2; NativeEncryption.LoginCryptInit(ref obj); }
public byte[] Compress(byte[] src, out int dest_size) { int len = src.Length; byte[] dest = new byte[len * 2]; NativeEncryption.Compress(dest, src, out dest_size, ref len); return(dest); }
public byte[] Encrypt(byte[] input, int len) { if (input.Length < len) { throw new ArgumentOutOfRangeException("len", "Requested data lenght is larger than specified buffer."); } byte[] output = new byte[len]; NativeEncryption.TwofishEncrypt(ref obj, input, output, len); return(output); }
public byte[] Encrypt(byte[] data, int len) { if (data.Length < len) { throw new ArgumentOutOfRangeException("len", "Requested data lenght is larger than specified buffer."); } byte[] encryptedData = new byte[len]; NativeEncryption.LoginCryptEncrypt(ref obj, data, encryptedData, len); return(encryptedData); }
public byte[] Decompress(byte[] src, int len, out int dest_size) { if (src.Length < len) { throw new ArgumentOutOfRangeException("len", "Requested data lenght is larger than specified buffer."); } byte[] dest = new byte[NativeEncryption.MIN_DECBUF_SIZE(len)]; NativeEncryption.Decompress(dest, src, out dest_size, ref len, ref obj); return(dest); }
public static bool CalculateKeys(byte[] Plaintext, byte[] Ciphertext, uint Seed, out uint Key1, out uint Key2) { if (Plaintext.Length < 61) { throw new ArgumentException("Plaintext array must be at least 61 bytes long.", "Plaintext"); } if (Ciphertext.Length < 61) { throw new ArgumentException("Ciphertext array must be at least 61 bytes long.", "Ciphertext"); } return(NativeEncryption.CalculateKeys(Plaintext, Ciphertext, ref Seed, out Key1, out Key2) > 0); }
public TwofishEncryption(uint seed) { obj = TwofishObj.Create; obj.IP = seed; NativeEncryption.TwofishInit(ref obj); }
public MD5(byte[] Data) { obj = MD5Obj.Create; NativeEncryption.MD5Init(ref obj, Data, (uint)Data.Length); }
public BlowfishEncryption() { obj = BlowfishObj.Create; NativeEncryption.BlowfishInit(ref obj); }
public Huffman() { obj = new HuffmanObj(); NativeEncryption.DecompressClean(ref obj); }