Home > Net >  The theory of how to protect the.net application database connection code
The theory of how to protect the.net application database connection code

Time:02-05

Seen many.net program, no matter how to disturb, how to call the c language to write the class library of encryption, can all be decompiled software, direct the caller's part of the code for the database connection, you have a good idea?

CodePudding user response:

The topic
1, the.net program entrance to determine the number of arguments, if the number is 0 (direct) indicates that the starter starts, quit,
2, the initiator by the go language (other can also, mainly against decompiling), code and the database connection. The.net application md5 value stored in the starter,
3, starter runtime checks.net application of md5 value (determine whether changes), again when meets the requirements to start the parameter way..net application,

CodePudding user response:

Considered using Windows messaging, afraid of being hook, also considered using udp to transfer, or afraid of being caught, now I haven't heard of initiator by parameters can be obtained, please advice,

CodePudding user response:

Architecture solved!
Database access permissions on the server, the server hold yourself database information. The client can only through the interface to access data, the database information can't get

CodePudding user response:

The
reference 3 floor ziqi0716 response:
architecture
solved!Database access permissions on the server, the server hold yourself database information. The client can only through the interface to access data, the database information can't get

Thank you for your reply
Written 3 layer is able to solve, but must not write their own service layer database ado.net connection mature and stable, I wrote a similar services, before the results often appear puzzling when big data error, maybe it's a level is not enough, don't know if prawns have good advice?

CodePudding user response:

reference 4 floor cn2719691 response:
Quote: reference ziqi0716 reply: 3/f
architecture solved!
Database access permissions on the server, the server hold yourself database information. The client can only through the interface to access data, the database information can't get

Thank you for your reply
Written 3 layer is able to solve, but must not write their own service layer database ado.net connection mature and stable, I wrote a similar services, before the results often appear puzzling when big data error, maybe it's a level is not enough, don't know if prawns have good advice?


Socket communication, database of 1433152 1330 6 why make these ports, nature is not still Socket communication, oneself write a server-side program throw used to receive the client sends SQL commands on the server, the server through ADO.Net and database results serialized back to the client, the client deserialization again good, plus login authentication between client and server, if the software you can combine together with the account login, so that the client will only need to save server IP and port with respect to OK, the rest is handle connection timeout and multithreading,

Of course to a B/S system, or the server to use such as WebAPI, WCF, WebService of what is possible

CodePudding user response:

several years ago once made a server to issued the encrypted database connection string, the client starts the connection string to connect the server, decrypted even the database directly, this way is simple and crude but with poor security, and database server normally has a white list only by specifying the server access, if your database does not have the restrictions may also consider, at least than the database logon account directly to the client better
  • Related