mirror of
https://github.com/oliverbooth/TcpDotNet
synced 2024-11-10 04:55:41 +00:00
perf: use static RandomNumberGenerator to generate AES key
This commit is contained in:
parent
ff78acfb56
commit
18b0ff3f25
@ -113,8 +113,7 @@ public sealed class ProtocolClient : ClientNode
|
|||||||
byte[] encryptedPayload = rsa.Encrypt(encryptionRequest.Payload, true);
|
byte[] encryptedPayload = rsa.Encrypt(encryptionRequest.Payload, true);
|
||||||
|
|
||||||
var key = new byte[128];
|
var key = new byte[128];
|
||||||
using var rng = new RNGCryptoServiceProvider();
|
RandomNumberGenerator.Fill(key);
|
||||||
rng.GetBytes(key);
|
|
||||||
|
|
||||||
Aes = CryptographyUtils.GenerateAes(key);
|
Aes = CryptographyUtils.GenerateAes(key);
|
||||||
byte[] aesKey = rsa.Encrypt(key, true);
|
byte[] aesKey = rsa.Encrypt(key, true);
|
||||||
|
Loading…
Reference in New Issue
Block a user