Closed ertankucukoglu closed 3 years ago
Hello Ertan, yes CSPRNG exists in this library, they are mostly wrappers around the CSPRNG's provided by the OS. The class you are looking for is "TSecureRandom".
I almost used the identical text in the examples.
uses
ClpSecureRandom,
ClpISecureRandom;
function GetRandomIVBytes(): TBytes;
var
FRandom: ISecureRandom;
begin
SetLength(Result, 16);
FRandom := TSecureRandom.Create();
FRandom.NextBytes(Result);
end;
Thanks.
Hello,
I could not be sure if there is cryptographically-secure pseudorandom number generator available in the library. I see "RNG wrappers for system RNG" is available, but I am not sure if that is the same thing.
I very much appreciate file names to check for examples for the RNG in the library even it is not cryptographically-secure.
What I am trying to do is to generate random IV for AES/CBC/PCKS#7 256 bit encryption/decryption.
I also read there are some ways to protect that random generated IV for replay attack attempts. I am not expert in anyway, but I can try to build something by researching and reading if library have helper functions for such.
Thanks & Regards, Ertan