System.Security.Cryptography has many cryptological functions.
They have hashes, crypts, streams and much more.
The RSA provider is good. And about keeping constants safe. I can only offer to store them in encrypted form in the solution. You will not be able to read them from the source, so there must be some protection after assembling the assembly. Maybe obfuscation, maybe something else. On key generation, do not use your own system or any development system, I think.
EDIT:
To generate keys, it is better to use either user input, for example, simply create a small application that calculates the time required to enter a specific piece of text for each letter.
Or use HRNG / TRNG, a hardware random number generator (uses real-world input from sensors). Or True Random Number Generator, basically also HRNG, but mostly with other input forms, very advanced.
RANDOM.ORG should be able to help you.
If itβs not so important, just pat yourself on the keyboard and see the results :).
source share