IMsgEncryptor.cs 836 B

12345678910111213141516171819202122232425262728
  1. namespace XGame.Framework.Network
  2. {
  3. /// <summary>
  4. /// 消息加密器
  5. /// </summary>
  6. public interface IMsgEncryptor
  7. {
  8. void SetKey(string key);
  9. /// <summary>
  10. /// 加密
  11. /// 结果替换原变量
  12. /// </summary>
  13. /// <param name="bytes"></param>
  14. /// <param name="offset"></param>
  15. /// <param name="length"></param>
  16. /// <returns></returns>
  17. void Encrypt(ref byte[] bytes, ref int offset, ref int length);
  18. /// <summary>
  19. /// 解密
  20. /// 结果替换原变量
  21. /// </summary>
  22. /// <param name="bytes"></param>
  23. /// <param name="offset"></param>
  24. /// <param name="length"></param>
  25. /// <returns></returns>
  26. void Decrypt(ref byte[] bytes, ref int offset, ref int length);
  27. }
  28. }