Giter Club home page Giter Club logo

Comments (9)

rapus95 avatar rapus95 commented on August 21, 2024 3

v1.1 contains it, including tests.

from sodium.jl.

rapus95 avatar rapus95 commented on August 21, 2024 1

A very basic (and probably errorprone) first iteration could be like that:

@eval Sodium function seal(msg, pk)
        sodium_init() < 1 && error("something didn't work")
        len = sizeof(msg)
        ciphertext = Vector{Cuchar}(undef, crypto_box_SEALBYTES + len)
        crypto_box_seal(ciphertext, msg, len, pk)
        return String(ciphertext)
      end

That's how I monkeypatched it for now 😁

EDIT: Replaced length(msg) by sizeof(msg) as msg can be a unicode string in which case we need to cover the fact that a single char can take multiple bytes.

from sodium.jl.

Gnimuc avatar Gnimuc commented on August 21, 2024

Since you wrapped the direct bindings in Sodium.LibSodium, adding convenience in Sodium seems like an actually good layout. 😄

Yeah, that's the plan, but I don't have the bandwidth of maintaining the helper APIs. 😂 I'm actually looking for someone to help with maintaining this package.

from sodium.jl.

Gnimuc avatar Gnimuc commented on August 21, 2024

I've read your message on the slack. But I only know how to maintain the wrapper generator part of the package, I actually never use this package. @bramtayl may chime in with the Github secrets stuff.

from sodium.jl.

bramtayl avatar bramtayl commented on August 21, 2024

I'm kinda in the same boat as @Gnimuc. My implementation in OnlinePackage is similar to yours;

raw_encoded = Vector{Cuchar}(undef, crypto_box_sealbytes() + length(private_key))
error_code = crypto_box_seal(
    raw_encoded,
    private_key,
    length(private_key),
    sodium_key
)
if error_code != 0
    error("Error using libsodium.crypto_box_seal")
end

from sodium.jl.

rapus95 avatar rapus95 commented on August 21, 2024

@bramtayl so I guess your private key is ascii only? 😄
Do you also need it to enable testing of private packages?

from sodium.jl.

Gnimuc avatar Gnimuc commented on August 21, 2024

I'm not 100% sure what I'm talking about, so just take this with a grain of salt. The encryption algorithms used in Github secrets and the default one used in libsoduim's crypto_box_seal may mismatch.

https://help.github.com/en/actions/configuring-and-managing-workflows/creating-and-storing-encrypted-secrets#about-encrypted-secrets

https://libsodium.gitbook.io/doc/public-key_cryptography/sealed_boxes#algorithm-details

from sodium.jl.

bramtayl avatar bramtayl commented on August 21, 2024

I got to that code via guess and check, so no idea tbh

from sodium.jl.

rapus95 avatar rapus95 commented on August 21, 2024

I think those will be working together flawlessly:
https://developer.github.com/v3/actions/secrets/#create-or-update-a-secret-for-a-repository

from sodium.jl.

Related Issues (3)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.