Home > Net >  C # is the response to compression of the returned json, encryption
C # is the response to compression of the returned json, encryption

Time:09-22

Originally I is the json string with GZipStream compression, and then returned to the client, the customer response data flow down now, and then a similar set encryption password, and then returned to the client, who is a great god experience sharing, thank you

CodePudding user response:

Regardless of whether the response compression encryption, originally the gzip process don't need a set, because the web server itself gzip compression can be configured to transmit content,
According to their needs to change, as long as your GZipStream method replacing their new encryption method, and then return to binary stream can be directly,

CodePudding user response:

A new encryption method is needed here, thank you, how to put the data stream encryption, need instance

CodePudding user response:

Where this instance? Your original code is gzipcompress (jsonbytes), directly to Encrypt (jsonbytes), and then the Response. The encrypted BinaryWrite array line ah,

CodePudding user response:

If you can set password security better

CodePudding user response:

If there really is a high security requirements, or consider SSL two-way authentication,