Recently at work we’ve had a new hire to work on a project of ours that utilizes AES-256-GCM encryption and decryption via PHP’s sodium extension. Since we all use Macbooks, the new employee received a 2020 Macbook Pro with M1 chip. The first attempt at getting the aforementioned project up and running was using a HomeBrew setup, which runs the
Tag: libsodium
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 = “…
PHP and Sodium – Unable to pass a nonce publicly in a form
As the title suggest i am having difficulty in passing the value of a nonce publicly through a form. I have tried using both a hidden field in the form and passing the value as a parameter in the url. The nonce is created using: When I try to use the retrieved value (eg sodium_crypto_secretbox_open) form either a hidden field
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: I have a Controller that uses a trait to generate the encryption commands. The trait looks like this so far However, upon testing this I receive this error: SQLSTATE[22007]: Invalid datetime format: 1366 Incorrect string value: ‘xFFXx8Afx1F$…’ for column ‘encryption_key’ at row 1 (SQL: insert
PHP Libsodium default encryption method
I’m sure this must’ve been asked and answered but can’t find where… With libsodium in PHP (7.0 / 7.1), what is the default encryption method employed (or where to find it) when you do something like this? A client wants it stated in the handover documentation but I can’t find what it is. Answer Algorithm details Encryption: XSalsa20 stream cipher
Using Libsodium with PHP on WAMP
I’m having really hard trouble installing libsodium on my local server (WAMP64). I used this guide and many others, but still no luck. I successfully installed PEAR but I can’t use it to install the PHP wrapper of libsodium. Can someone post a little guide step by step to help me? I would appreciate help installing Halite, wich needs libsodium,