r-lib / sodium

R bindings to libsodium
https://docs.ropensci.org/sodium
Other
69 stars 11 forks source link

JS encryption method compatible with simple_decrypt #7

Open geotheory opened 6 years ago

geotheory commented 6 years ago

Not really your problem, but for some users this is the other half of the equation..

I wonder if you can offer any advice on any workflow to replicate the simple_encrypt step with a remote client browser using just javascript? I've been looking at various libraries but can't figure out the flow to use a key generated in sodium..

jeroen commented 6 years ago

I think the web crypto standards implemented in browsers only support NIST curves. So you need the R package openssl to work with those on the other end.

I found this website very useful: https://github.com/diafygi/webcrypto-examples . All of these are implemented in the R package openssl as well.

Also have a look at the jose package which wraps openssl to implement some of the new json based formats jwt and jwk in R.

dirkschumacher commented 4 years ago

@geotheory take a look at tweetnacl. It runs in the browser and should be compatible.