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
2
votes
1 answer

How to encrypt JSON object with JS-NaCl and decrypt with php Libsodium

I managed to find a Libsodium js library (JS-NaCl) for front end encryption and has setup my PHP backend for Libsodium encrypt/decrypt also. When I encrypt a JSON object like below const key = "827ccb0eea8a706c4c34a16891f84e7b"; const nonce =…
CliffTheCoder
  • 394
  • 1
  • 4
  • 24
2
votes
1 answer

ENCONDING CHARACTERS problem in php sodium functions

I really don't now what i have to do. I tried a install anothers libsodium's versions but i had problems with Modules. Hope you can help me, because i don't know if i'm using the functions correctly... phpinfo has returned that libsodium is…
2
votes
1 answer

NSec.Cryptography encrypt and decrypt using ChaCha20Poly1305 and SharedSecret

I'm trying to encrypt (and decrypt) messages send from one device to another by using NSec.Cryptography, but I find the documentation a bit vague. As I understood I need a Key and PublicKey of device A and B, respectively. I can turn these into a…
Yuri van Geffen
  • 853
  • 1
  • 7
  • 21
2
votes
1 answer

Cargo test does not work anymore because of Libsodium failing on: pwhash_argon2i and pwhash_argon2id

I just updated my near-bindgen version and when trying to run tests using: cargo test --package my-package I get the following error caused by Libsodium: make[4]: *** [test-suite.log] Error 1 make[3]: *** [check-TESTS] Error 2 make[2]: ***…
jasper
  • 937
  • 1
  • 9
  • 22
2
votes
0 answers

Libsodium questions

I'm interested in using libsodium to encrypt the data stream between a client and server application. The data consists of a (semi-infinite) sequence of bi-directional messages of varying length that are transmitted over a socket. The application is…
H. Guijt
  • 3,325
  • 11
  • 16
2
votes
2 answers

Length of return from php libsodium sodium_crypto_pwhash_str()

How long is the string returned by sodium_crypto_pwhash_str() in PHP? Does it vary with the plaintext? The options $opslimit and $memlimit? Basically, I want to know how long a database field to give it.
user3250335
  • 457
  • 2
  • 4
  • 13
2
votes
1 answer

Unity3d: Unable to include LibSodium libraries

I am working on a unity project and want to use Sodium for cryptography (public key sealed box). The problem is, when I install any library (and I've tried many), the library appears in the assembly references section for a few seconds and then…
2
votes
0 answers

Getting 'BadImageFormatException' when loading libsodium.dll in Visual Studio 17

I have the libsodium-net NuGet loaded into my PoC solution and have the 32-bit and 64-bit libsodium.dll files in their respective directories (System32 and SysWOW64). Whenever I go to run the program in debug mode, I get the BadImageFormatException…
TOTM
  • 107
  • 7
2
votes
2 answers

libsodium crypto_sign_open returns unsigned message adding some characters

In my C++ project I'm using libsodium library to create and verify the signature of a message. To verify the signature I'm using the libsodium crypto_sign_open function in this way bool Signature::signatureVerification(const char* content, unsigned…
Ricla
  • 105
  • 1
  • 9
2
votes
0 answers

C# SQLite escape '=' sign in prepared statement

I am currently developing my own password manager in c#. I have a problem in my update function: protected internal bool Update() { // the updatestring that gets insert into the sqlitecommand string updatestring = ""; //…
2
votes
1 answer

What is the best way to encrypt data without using the resource of mysql server ? Is mcrypt with CFB mode the best way with php?

I have a huge database with non encrypted fields. These data are sensitive and the managers took a decision to encrypt them as soon as we can. And all new data should be automatically encrypted to the same way. First Method: If I use aes_encrypt to…
am909090
  • 83
  • 1
  • 7
2
votes
0 answers

PHP7.2 libsodium doesn't seem to load macros

Hello I'm trying to deploy a intranet web server at my house, so I installed centOS on a machine, together with apache, php7.2 and mysql. However, my php application depends on libsodium for data encryption, so I ran sudo yum install…
Alexandre Krabbe
  • 727
  • 1
  • 13
  • 33
2
votes
1 answer

How upgrade PHP extension (Libsodium)

I'm using Libsodium-PHP, and I'm seeing that the ParagonIE_Sodium_Compat::crypto_pwhash function produces different results (with the same arguments) when called from the command line versus when called from within the app running on PHP-FPM. This…
Ryan
  • 22,332
  • 31
  • 176
  • 357
2
votes
1 answer

Encrypt/ Decrypt - Secret-key authenticated encryption in Libsodium (beginner)

I am trying to encrypt and decrypt a simple string by following the example here Here #define MESSAGE ((const unsigned char *) "test") #define MESSAGE_LEN 4 #define CIPHERTEXT_LEN (crypto_secretbox_MACBYTES + MESSAGE_LEN) unsigned char…
Joe
  • 619
  • 1
  • 8
  • 16
2
votes
1 answer

php sodium_crypto_pwhash_str_verify() fails

I'm trying to figure out how to use the new libsodium features in php7.2, but for some reason I can't seem to get sodium_crypto_pwhash_str_verify() to work properly. I decided to actually use the given example in their documentation:…
Katai
  • 2,773
  • 3
  • 31
  • 45