I have a windows application in C#.Net which uses mysql database to store data. Mysql DB and windows application are on the same machine. I am working through a security audit for a system at my work and one of the requirements is to encrypt all traffic between C# and Mysql. I have already implemented openssl and the connection has now encrypted but I also need to encrypt the Data traffic between c# and mysql. For e.g when the insert query executes from c#, the packet software (echo mirage) shows clear text(whole insert query with data) may be the reason is my c# application is using hardcode queries instead of stored procedures. How can I encrypt the traffic? Please help
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Generic Generics in Managed C++
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
If one of your requirements is "to encrypt all traffic between C# and Mysql", then I would recommend setting the
require_secure_transport
system variable (on your MySQL Server) to 1. This will prevent any insecure connections from being created at all.You will also need to configure your MySQL Server to use SSL, as per this tutorial (which you referenced in the comments).
In your C# program, make sure you have
SslMode=Required
in your connection string. This will ensure that all traffic between C# and MySQL, including queries and responses, is encrypted (apart from a short plaintext handshake at the very beginning of a connection).Once this is done, Echo Mirage (or any network packet capture tool) will not be able to read the plain text of queries on the wire.