You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
π [Docs]: Rework README into the standard module landing page (#66)
The Sodium README is now a concise landing page that leads with what the
module does and how to use it.
- **Usage showcase restored** β end-to-end examples for generating a key
pair (`New-SodiumKeyPair`), encrypting with a public key
(`ConvertTo-SodiumSealedBox`), and decrypting a sealed box
(`ConvertFrom-SodiumSealedBox`).
- **Attribution restored** β the `## Acknowledgements` section crediting
the upstream **libsodium** library is back (required by the standard).
- **Prerequisites restored** β libsodium, cross-platform PowerShell 7.4+
(the module ships a net8.0 binary), and the Windows Visual C++
Redistributable note.
- **Installation** uses `Install-PSResource`.
- **Documentation** links to psmodule.io/Sodium with a
copy-paste-friendly discovery snippet.
- Removed the `## Contributing` section (repository governance files are
handled by a separate rollout).
Documentation only β no source or functional changes.
Copy file name to clipboardExpand all lines: README.md
+26-57Lines changed: 26 additions & 57 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,34 +1,37 @@
1
1
# Sodium
2
2
3
-
A PowerShell module that provides direct bindings to the [`libsodium`](https://github.com/jedisct1/libsodium) cryptographic library.
3
+
Sodium is a PowerShell module that provides direct bindings to the [`libsodium`](https://github.com/jedisct1/libsodium)
4
+
cryptographic library, enabling libsodium-based encryption and decryption directly from PowerShell.
4
5
5
6
This module was initially created to serve the needs of the [GitHub PowerShell module](https://github.com/PSModule/GitHub).
6
-
GitHub's method for creating or updating [secrets via the REST API](https://docs.github.com/en/rest/guides/encrypting-secrets-for-the-rest-api?apiVersion=2022-11-28#example-encrypting-a-secret-using-c)
7
-
requires that secrets be encrypted using the [libsodium](https://github.com/jedisct1/libsodium) library.
7
+
GitHub's method for creating or updating
8
+
[secrets via the REST API](https://docs.github.com/en/rest/guides/encrypting-secrets-for-the-rest-api?apiVersion=2022-11-28#example-encrypting-a-secret-using-c)
9
+
requires that secrets be encrypted using libsodium.
8
10
9
11
## Prerequisites
10
12
11
-
This module relies on the following external resources:
13
+
This module relies on the following:
12
14
13
-
- The [PSModule framework](https://github.com/PSModule) for building, testing, and publishing the module.
14
15
- The [libsodium](https://github.com/jedisct1/libsodium) library for cryptographic operations.
16
+
- Cross-platform PowerShell 7.4 or later (the module ships a net8.0 binary).
17
+
18
+
On Windows, the module also requires the Microsoft Visual C++ Redistributable for Visual Studio 2015 or later.
15
19
16
20
## Installation
17
21
18
-
To install the module from the PowerShell Gallery, use the following command:
22
+
Install the module from the PowerShell Gallery:
19
23
20
24
```powershell
21
25
Install-PSResource -Name Sodium
22
26
Import-Module -Name Sodium
23
27
```
24
28
25
-
## Examples
29
+
## Usage
26
30
27
-
### Example 1: Generate a new key pair
31
+
### Example: Generate a new key pair
28
32
29
-
The module provides functionality to create a new cryptographic key pair.
30
-
The keys are returned as a PowerShell custom object with `PublicKey` and `PrivateKey` properties, encoded in base64 format.
31
-
For more info on the key pair generation, refer to the [Public-key signatures documentation](https://doc.libsodium.org/public-key_cryptography/public-key_signatures).
33
+
Create a new cryptographic key pair. The keys are returned as an object with `PublicKey` and `PrivateKey`
### Example 3: Encrypt a message using a public key (Sealed Boxes encryption)
54
-
55
-
After generating a key pair, a message can be encrypted using the associated public key with [Sealed Boxes encryption](https://doc.libsodium.org/public-key_cryptography/sealed_boxes).
56
-
Below, a message is encrypted using the public key from the previous example.
46
+
Encrypt a message using a recipient's public key with
### Example 4: Decrypt a Sodium-encrypted sealed box string
59
+
### Example: Decrypt a sealed box
69
60
70
-
To decrypt a string that was encrypted using [Sealed Boxes encryption](https://doc.libsodium.org/public-key_cryptography/sealed_boxes), both the private and public keys are required.
61
+
Decrypt a sealed box back to the original message. Both the public and private keys are required.
0 commit comments