-
-
Notifications
You must be signed in to change notification settings - Fork 3
libsodium.SKI.SecretKey
Andrew Lambert edited this page Nov 26, 2022
·
13 revisions
Protected Class SecretKey
This class contains a secret key for use with symmetric key encryption and message authentication. Encryption, decryption, and MAC generation/validation use the same key, so it must be kept secret at all times.
To generate a brand new secret key use the Generate() shared method. To derive a secret key from a Password use the Constructor(Password) method. Derivation requires a random salt, which you should get from the Password.RandomSalt shared method.
Encryption/decryption needs a Nonce value to work. Use the RandomNonce() shared method to generate securely random nonces.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2016-24 Andrew Lambert, offered under the CC BY-SA 3.0 License.