Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/federicoceratto/nim-libsodium
Nim wrapper for the libsodium library
https://github.com/federicoceratto/nim-libsodium
cryptography library libsodium nacl nim nim-lang nim-language security wrapper
Last synced: 1 day ago
JSON representation
Nim wrapper for the libsodium library
- Host: GitHub
- URL: https://github.com/federicoceratto/nim-libsodium
- Owner: FedericoCeratto
- License: mpl-2.0
- Created: 2016-05-10T23:40:23.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2023-11-21T17:45:42.000Z (12 months ago)
- Last Synced: 2023-11-21T18:42:37.373Z (12 months ago)
- Topics: cryptography, library, libsodium, nacl, nim, nim-lang, nim-language, security, wrapper
- Language: Nim
- Size: 144 KB
- Stars: 44
- Watchers: 8
- Forks: 13
- Open Issues: 2
-
Metadata Files:
- Readme: README.adoc
- License: LICENSE
Awesome Lists containing this project
README
## nim-libsodium
Nim wrapper for the libsodium library
image:https://github.com/FedericoCeratto/nim-libsodium/workflows/build/badge.svg?branch=master["Build Status", link="https://github.com/FedericoCeratto/nim-libsodium/actions"]
image:https://img.shields.io/badge/status-beta-orange.svg[badge]
image:https://img.shields.io/github/tag/FedericoCeratto/nim-libsodium.svg[tags]
image:https://img.shields.io/badge/License-MPL%20v2.0-blue.svg[License]### Features
* Wrap libsodium and expose only memory-safe entities
* Follow libsodium naming convention for most functions
* Tested on Linux, MacOS and windows
* Basic unit tests
* No homemade crypto### Usage
Refer to the link:https://download.libsodium.org/doc/index.html[official libsodium documentation]
and the generated documentation using `nim doc`.
Also, the structure of libsodium/sodium.nim follows the order of https://doc.libsodium.org/
[source,bash]
----
sudo apt-get install libsodium18
nimble install libsodium
----[source,nim]
----
import libsodium.sodium
import libsodium.sodium_sizeslet
msg = "hello and goodbye"
(pk, sk) = crypto_box_keypair()
nonce = randombytes(crypto_box_NONCEBYTES())
ciphertext = crypto_box_easy(msg, nonce, pk, sk)----
### Contributing
Testing and PRs are welcome.