-
-
Notifications
You must be signed in to change notification settings - Fork 3
libsodium.PKI.SharedSecret.DeriveSharedSecret
Andrew Lambert edited this page Jan 5, 2017
·
13 revisions
libsodium.PKI.SharedSecret.DeriveSharedSecret
##Method Signatures
Shared Function DeriveSharedSecret(RecipientPublicKey As MemoryBlock, SenderPrivateKey As libsodium.PKI.EncryptionKey) As MemoryBlock##Return value The shared secret data.
##Remarks
Computes a shared secret (NOT a key) given a SenderPrivateKey and RecipientPublicKey. The return value represents the X coordinate of a point on the curve. As a result, the number of possible keys is limited to the group size (≈2^252), and the key distribution is not uniform.
For this reason, instead of directly using the return value as a shared key, it is recommended to use:
GenericHash(return value + RecipientPublicKey + SenderPrivateKey)Or just use the Constructor method.
Wiki home | Project page | Bugs | Become a sponsor
Text and code examples are Copyright ©2016-26 Andrew Lambert, offered under the CC BY-SA 3.0 License.
- libsodium module
- FAQ
-
Examples
- Secure memory
- Password hashing
- Generic hashing
- Encrypting streams or files
- PKI
- Encryption
- Digital signatures
- SKI
- Encryption
- Message authentication