1.0.15.1
charlesportwoodii
released this
09 Oct 20:42
·
10 commits
to master
since this release
1.0.15.1 Release
libsodium-uwp
is a Universal Windows Runtime Component that exposes the libsodium
library to both desktop and mobile universal windows applications.
What's New?
-
Adds support for Secret Streams.
// Starting on the sender // Create a new key var key = Sodium.SecretStream.GenerateKey(); // Create a new header var header = Sodium.SecretStream.GenerateHeader(); // Create a new stream in PUSH mode to push new messages onto the stream. var encrypter = new Sodium.SecretStream(key, header, Sodium.SecretStream.MODE_PUSH); var message1 = "Hello, World!"; var message2 = "{ \"json\": \"data\" }"; var ciphertext1 = encrypter.Push(message1); var ciphertext2 = encrypter.Push(message2, Sodium.SecretStream.TAG_FINAL); // On the peer, create a PULL stream, and pull in the stream as it comes in from the peer and decrypt it var decrypter = new Sodium.SecretStream(key, header, Sodium.SecretStream.MODE_PULL); // System.Text.Encoding.UTF8.GetBytes(message1) == d1 var d1 = decrypter.Pull(ciphertext1); // System.Text.Encoding.UTF8.GetBytes(message2) == d2 var d2 = decrypter.Pull(ciphertext2, Sodium.SecretStream.TAG_FINAL);
See https://github.com/charlesportwoodii/libsodium-uwp/blob/1.0.15.1/docs/SecretStream.md and https://download.libsodium.org/doc/secret-key_cryptography/secretstream.html for more information on Secret Streams.
Installation
-
Install from Nuget
Install-Package libsodium-uwp
-
Add the following to your
Package.appxmanifest
file.<Extensions> <Extension Category="windows.activatableClass.inProcessServer"> <InProcessServer> <Path>libsodium-uwp.dll</Path> <ActivatableClass ActivatableClassId="Sodium.Core" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.CryptoHash" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.GenericHash" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.GenericHashAlgorithmProvider" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.GenericHashAlgorithmNames" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.KDF" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.KeyPair" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.OneTimeAuth" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.PasswordHash" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.PublicKeyAuth" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.PublicKeyBox" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.ScalarMult" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.SealedPublicKeyBox" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.SecretBox" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.SecretKeyAuth" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.SecretAead" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.SecretStream" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.ShortHash" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.StreamEncryption" ThreadingModel="both" /> <ActivatableClass ActivatableClassId="Sodium.Utilities" ThreadingModel="both" /> </InProcessServer> </Extension> </Extensions>
Package Verification
The following hashes are made available so you can verify the authenticity of this package both on Github and Nuget.
md5: c79cdaf054fe9eddd0ceb1e0bd6fe567 libsodium-uwp.1.0.151.nupkg
sha1: 2e0848f3ae2eebf6e48f03f1dfa9a930ff16c7e4 libsodium-uwp.1.0.151.nupkg
sha256: 0666fe5effd11e7229cd51e7b0c648a4728493c064e661f7a00f2e69b4877d71 libsodium-uwp.1.0.151.nupkg
md5: ebf4904e66c8a9b8184d8e284688d322 libsodium-uwp.1.0.151.symbols.nupkg
sha1: b8a645b640c704a9ddd9389780c444e2df59e330 libsodium-uwp.1.0.151.symbols.nupkg
sha256: bd7ca4f9c41deb6f8a782a40101a208426b5c5e835a44e6955eb675494def7db libsodium-uwp.1.0.151.symbols.nupkg
The Nuget package is also signed so you can verify the authenticity of this package.