Skip to content

libsodium.SKI.SecretKey

Andrew Lambert edited this page Nov 26, 2022 · 13 revisions

libsodium.SKI.SecretKey

Class Declaration

 Protected Class SecretKey

Remarks

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.

Methods

Shared methods

Clone this wiki locally