Questions tagged [libsodium]

Sodium is a portable, cross-compilable, installable, packageable fork of the NaCl Cryptography & Networking library, with a compatible API.

Sources & Resources:

322 questions
4
votes
2 answers

Retrieving encryption key from database in python PyNaCl, how do i convert back into a PublicKey or a PrivateKey object?

I'm trying to store the private/public keys as UTF-8 strings in a database. The problem is that when I bring them back into code, they are not the correct type. As bytes they print the same, as per the following code: import nacl.utils from…
zamarov
  • 165
  • 2
  • 16
4
votes
0 answers

Howto patch/shim crypto.getRandomValues for React Native

I am porting some packages created for NodeJS to React Native using ReactNativify to rewrite Node API object dependencies to their browserify equivalents. One of them is crypto. In transformer.js (or .babelrc) I have: // The following plugin will…
4
votes
1 answer

C++ - Undefined reference to "sodium_init"

I am attempting to make a testing application using libsodium, however I am getting the error: main.cpp:6: undefined reference to `sodium_init' I ran the following commands to install in as the root user. $ ./configure $ make && make check $ make…
J. Doe
  • 97
  • 2
  • 6
4
votes
1 answer

Strange behavior of crypto_box_easy and crypto_box_open_easy. Decrypt without private key?

I have tested Public-key-cryptography by libsodium and came across a strange behavior. The encrypted message is decrypted without the private key. Example from official site libsodium #include "sodium.h" #define MESSAGE "test" #define…
Lexeich
  • 43
  • 6
4
votes
1 answer

libsodium-64.dll not found in production Azure Service Fabric cluster

Using libsodium-net for all of its security goodness in an Azure Service Fabric Reliable Service, on my local dev cluster everything is working fine (although I did have to set the libsodium-64.dll to copy to the output directory). Unfortunately,…
Tom Davies
  • 899
  • 6
  • 20
3
votes
1 answer

Does PyNaCl release GIL and should it be used with multithreading

Does PyNaCl release the Global Interpreter Lock? Will it be suitable to use multithreading for encryption using PyNaCl's SecretBox? I want to encrypt relatively large amounts of data (~500 MB) using PyNaCl. For this, I divide it into chunks of…
kush
  • 154
  • 1
  • 12
3
votes
2 answers

Include polyfills in webpack > 5 in CRA

I'm trying to use an NPM package called "libsodium-wrappers" inside a browser with React using Create React App, but getting the following error: BREAKING CHANGE: webpack < 5 used to include polyfills for node.js core modules by default. This is no…
3
votes
1 answer

Can't walk dependency graph: Cannot find module './crypto_auth' sodium-universal

I am getting the following error when attempting to browserify a node project (https://github.com/datproject/sdk) and am getting the following error. Error: Can't walk dependency graph: Cannot find module './crypto_auth' from…
Lee
  • 29,398
  • 28
  • 117
  • 170
3
votes
1 answer

Hyperledger Indy LibIndy Installation Issue on Ubuntu 18.04

My development environment is Ubuntu 18.04 LTS. I have cloned the Indy SDK from the GitHub repository. When I am trying to install libindy which is essential for Indy node and Indy pool, it is failing due to the non-availability of Libsodium18. I…
3
votes
1 answer

Pseudo Random number generation in C using libsodium

I am trying to create a sequence of integers which is the same everytime as the generator is seeded however I am struggling to get it working. Right now the sequence is never the same. #include "sodium.h" #include #include…
Lamebro1
  • 57
  • 6
3
votes
2 answers

Encrypt on frontend (sodium-plus.js) with public-key from backend (PHP sodium)

I would like to achieve an anonymous public-key encryption in a web browser using sodium-plus.js with keys generated in PHP sodium like this: $keyPair = sodium_crypto_box_keypair(); $privateKey = sodium_crypto_box_secretkey($keyPair); $publicKey =…
lesDev
  • 77
  • 1
  • 8
3
votes
1 answer

How to add linker flags in CLion

Im trying to use libsodium, ive installed the librarys and trying to make the simplests of tests, when making the project using Makefile there are no probkems but when using CLion and Cmake i get "undefined reference to `sodium_init'" Im working on…
3
votes
1 answer

How can I store random_bytes in a database in PHP?

Inside of my migration I have a string column named encryption_key which looks like this: $table->string('encryption_key')->unique(); I have a Controller that uses a trait to generate the encryption commands. use LiveChat; public function…
Jaquarh
  • 6,493
  • 7
  • 34
  • 86
3
votes
1 answer

Decision behind libsodium AEAD implementation

RFC 7539 defines its AEAD construction as follows: chacha20_aead_encrypt(aad, key, iv, constant, plaintext): nonce = constant | iv otk = poly1305_key_gen(key, nonce) ciphertext = chacha20_encrypt(key, 1, nonce, plaintext) mac_data = aad…
user3368561
  • 779
  • 6
  • 18
3
votes
0 answers

Node.js Sodium install failure

I have been getting some errors when trying to install Sodium and a couple others. They all have the same error (with different names of course). I tried to solve it myself but ended up not being able too. It also happens with node-opus and it also…
1 2
3
21 22