mirror of
https://github.com/oliverbooth/TcpDotNet
synced 2024-11-09 23:25:42 +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);
|
||||
|
||||
var key = new byte[128];
|
||||
using var rng = new RNGCryptoServiceProvider();
|
||||
rng.GetBytes(key);
|
||||
RandomNumberGenerator.Fill(key);
|
||||
|
||||
Aes = CryptographyUtils.GenerateAes(key);
|
||||
byte[] aesKey = rsa.Encrypt(key, true);
|
||||
|
Loading…
Reference in New Issue
Block a user