{"id":16981359,"url":"https://github.com/charonn0/rb-libsodium","last_synced_at":"2026-01-04T22:33:59.995Z","repository":{"id":40302558,"uuid":"54546755","full_name":"charonn0/RB-libsodium","owner":"charonn0","description":"A Realbasic and Xojo binding to libsodium","archived":false,"fork":false,"pushed_at":"2024-07-07T22:45:31.000Z","size":1303,"stargazers_count":6,"open_issues_count":0,"forks_count":3,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-01-26T17:47:49.995Z","etag":null,"topics":["curve25519","diffie-hellman","digital-signature","ed25519","encryption","libsodium","nacl","pbkdf2","realbasic","x25519","xojo"],"latest_commit_sha":null,"homepage":"","language":"REALbasic","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/charonn0.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"charonn0"}},"created_at":"2016-03-23T09:24:28.000Z","updated_at":"2024-07-07T22:45:34.000Z","dependencies_parsed_at":"2024-06-22T16:48:25.657Z","dependency_job_id":"c5be8942-063f-4967-acf1-fe28965ae7e6","html_url":"https://github.com/charonn0/RB-libsodium","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-libsodium","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-libsodium/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-libsodium/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/charonn0%2FRB-libsodium/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/charonn0","download_url":"https://codeload.github.com/charonn0/RB-libsodium/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244883061,"owners_count":20525960,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["curve25519","diffie-hellman","digital-signature","ed25519","encryption","libsodium","nacl","pbkdf2","realbasic","x25519","xojo"],"created_at":"2024-10-14T02:05:16.467Z","updated_at":"2026-01-04T22:33:59.966Z","avatar_url":"https://github.com/charonn0.png","language":"REALbasic","funding_links":["https://github.com/sponsors/charonn0"],"categories":[],"sub_categories":[],"readme":"## Introduction\n[libsodium](https://github.com/jedisct1/libsodium) is a cross-platform fork of the [NaCl](http://nacl.cr.yp.to/) cryptographic library. It provides secret-key and public-key encryption ([XSalsa20](https://en.wikipedia.org/wiki/Salsa20)), message authentication ([Poly1305](https://en.wikipedia.org/wiki/Poly1305)), digital signatures ([Ed25519](https://en.wikipedia.org/wiki/EdDSA)), key exchange ([X25519](https://en.wikipedia.org/wiki/Curve25519)), generic hashing ([BLAKE2b](https://en.wikipedia.org/wiki/BLAKE_(hash_function)), SHA256, SHA512), password hashing and key derivation ([scrypt](https://en.wikipedia.org/wiki/Scrypt) or [Argon2i](https://en.wikipedia.org/wiki/Argon2)), in addition to facilities for guarded memory allocations and constant-time string comparisons. \n\n**RB-libsodium** is a libsodium [binding](http://en.wikipedia.org/wiki/Language_binding) for Realbasic and Xojo (\"classic\" framework) projects. Library binaries for [a number of platforms](https://download.libsodium.org/libsodium/releases/) are available, or can built from source. \n\n## Example\nThis example generates and validates a password hash that is suitable to be stored in a database ([more examples](https://github.com/charonn0/RB-libsodium/wiki/Examples)):\n```vbnet\n  Dim pw As libsodium.Password = \"seekrit\"\n  Dim hash As String = pw.GenerateHash()\n  If Not pw.VerifyHash(hash) Then MsgBox(\"Bad password!\")\n```\n\n## Hilights\n* [Password hashing](https://github.com/charonn0/RB-libsodium/wiki/libsodium.Password.GenerateHash) and [Password-based key derivation (PBKDF2)](https://github.com/charonn0/RB-libsodium/wiki/libsodium.Password.DeriveKey) using either Argon2 or scrypt\n* [Secret-key](https://github.com/charonn0/RB-libsodium/wiki/libsodium.SKI) and [public-key](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI) cryptography\n* Diffie-Hellman key exchange ([X25519](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.SharedSecret))\n* Secret-key [message authentication](https://github.com/charonn0/RB-libsodium/wiki/libsodium.SKI.GenerateMAC)\n* Public-key [message signatures](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.SignData)\n* Fast generic or keyed hashing using [BLAKE2b](https://github.com/charonn0/RB-libsodium/wiki/libsodium.GenericHash), [SHA512](https://github.com/charonn0/RB-libsodium/wiki/libsodium.SHA512), or [SHA256](https://github.com/charonn0/RB-libsodium/wiki/libsodium.SHA256)\n* [Secured memory](https://github.com/charonn0/RB-libsodium/wiki/libsodium.SecureMemoryblock) allocations\n* Import and export keys, messages, hashes, etc. with optional password protection.\n\n## Become a sponsor\nIf you use this code in a commercial project, or just want to show your appreciation, please consider sponsoring me through GitHub. https://github.com/sponsors/charonn0\n\n## Synopsis\nRB-libsodium is designed to make it as hard as possible to write bad crypto code. For example signing keys can't be used to perform encryption, so methods that need a signing key will require an instance of the [SigningKey](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.SigningKey) class as a parameter; attempting to pass an [EncryptionKey](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.EncryptionKey) will generate a compiler error. \n\nAll key types are represented by a different class:\n\n|Object Class|Comment|\n|-----------|-------|\n|[`EncryptionKey`](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.EncryptionKey)|A private key for use with Diffie–Hellman based encryption.| \n|[`PublicKey`](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.PublicKey)|A public key for use with encryption or signatures.| \n|[`SecretKey`](https://github.com/charonn0/RB-libsodium/wiki/libsodium.SKI.SecretKey)|A secret key for use with symmetric encryption and message authentication.| \n|[`SharedSecret`](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.SharedSecret)|A shared secret encryption key derived using a Diffie–Hellman key exchange.|\n|[`SigningKey`](https://github.com/charonn0/RB-libsodium/wiki/libsodium.PKI.SigningKey)|A private key for use with EdDSA-based signatures.| \n\nlibsodium uses state-of-the-art cryptographic primitives and algorithms based on [elliptic curves](https://en.wikipedia.org/wiki/Elliptic_curve_cryptography) (\"ECC\"). ECC provides comparable security to older systems based on prime factorization, such as RSA, but with much smaller key sizes. For example, a 224-bit (28 byte) ECC key provides a level of security that is comparable to a 2,048-bit (256 byte) RSA key. For comparison, [NIST recommends](https://www.keylength.com/en/4/) a RSA key size of at least 3,072 bits to ensure security through the year 2030.\n\n## How to incorporate libsodium into your Realbasic/Xojo project\n### Import the libsodium module\n1. Download the RB-libsodium project either in [ZIP archive format](https://github.com/charonn0/RB-libsodium/archive/master.zip) or by cloning the repository with your Git client.\n2. Open the RB-libsodium project in REALstudio or Xojo. Open your project in a separate window.\n3. Copy the libsodium module into your project and save.\n\n### Ensure the libsodium shared library is installed\nlibsodium is not ordinarily installed by default on most operating systems, you will need to ship necessary DLL/SO/DyLibs with your application. You can use pre-built binaries available [here](https://download.libsodium.org/libsodium/releases/), or you can [build them yourself from source](https://github.com/jedisct1/libsodium). \n\nRB-libsodium will raise a PlatformNotSupportedException when used if all required DLLs/SOs/DyLibs are not available at runtime. \n\n## [Examples](https://github.com/charonn0/RB-libsodium/wiki/Examples)\n* [Secure memory](https://github.com/charonn0/RB-libsodium/wiki/Secure-Memory-Example)\n* [Password hashing](https://github.com/charonn0/RB-libsodium/wiki/Password-Example#generate-a-hash)\n* [Generic hashing](https://github.com/charonn0/RB-libsodium/wiki/Generic-Hash-Example)\n* [Encrypting streams or files](https://github.com/charonn0/RB-libsodium/wiki/libsodium.SKI.SecretStream#example)\n  * [...with gzip compression](https://github.com/charonn0/RB-libsodium/wiki/Compressed-SecretStream-Example)\n  * [Password protected file example](https://github.com/charonn0/RB-libsodium/wiki/Examples#putting-it-all-together)\n* PKI\n  * Encryption\n    * [Generate a key pair](https://github.com/charonn0/RB-libsodium/wiki/PKI-Encryption-Examples#generate-a-new-random-encryption-key)\n    * [Derive a key pair from a password](https://github.com/charonn0/RB-libsodium/wiki/PKI-Encryption-Examples#generate-a-new-encryption-key-from-a-password-pbkdf2)\n    * [Encrypt data](https://github.com/charonn0/RB-libsodium/wiki/PKI-Encryption-Examples#encrypt-data)\n    * [Decrypt data](https://github.com/charonn0/RB-libsodium/wiki/PKI-Encryption-Examples#decrypt-data)\n  * Digital signatures\n    * [Generate a key pair](https://github.com/charonn0/RB-libsodium/wiki/PKI-Digital-Signature-Examples#generate-a-new-random-key-pair)\n    * [Derive a key pair from a password](https://github.com/charonn0/RB-libsodium/wiki/PKI-Digital-Signature-Examples#generate-a-new-encryption-key-from-a-password-pbkdf2)\n    * [Sign data](https://github.com/charonn0/RB-libsodium/wiki/PKI-Digital-Signature-Examples#sign-data)\n    * [Verify data](https://github.com/charonn0/RB-libsodium/wiki/PKI-Digital-Signature-Examples#verify-data)\n* SKI\n  * Encryption\n    * [Generate a key](https://github.com/charonn0/RB-libsodium/wiki/SKI-Encryption-Examples#generate-a-new-random-key)\n    * [Derive a key from a password](https://github.com/charonn0/RB-libsodium/wiki/SKI-Encryption-Examples#generate-a-new-key-from-a-password-pbkdf2)\n    * [Encrypt data](https://github.com/charonn0/RB-libsodium/wiki/SKI-Encryption-Examples#encrypt-data)\n    * [Decrypt data](https://github.com/charonn0/RB-libsodium/wiki/SKI-Encryption-Examples#decrypt-data)\n  * Message authentication\n\t* [Generate a MAC](https://github.com/charonn0/RB-libsodium/wiki/SKI-Encryption-Examples#generate-and-validate-a-message-authentication-code)\n    * [Verify a MAC](https://github.com/charonn0/RB-libsodium/wiki/SKI-Encryption-Examples#generate-and-validate-a-message-authentication-code)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharonn0%2Frb-libsodium","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcharonn0%2Frb-libsodium","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcharonn0%2Frb-libsodium/lists"}