libsodium

Libsodium “Call to undefined function sodium_randombytes_buf” [closed]

坚强是说给别人听的谎言 提交于 2019-12-02 07:01:50
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 2 years ago . Trying to follow the examples here, but it gives me Fatal error: Uncaught Error: Call to undefined function sodium_randombytes_buf() On top of that, the key pairs seems to be generating weird strings like: kÿòjƒFDú{î—4]F◊î¸˜ßˆu…®_•A∞+ . Is that normal? Here's my code <?php // send $message = 'Hi, this is Alice'

Simple Javascript encryption using Libsodium.js in this sandbox demo

拟墨画扇 提交于 2019-12-02 02:29:08
I've spent an embarrasing number of hours trying to get Libsodium.js to work. See my fiddle demo (and code pasted below too). I keep getting Error: wrong secret key for the given ciphertext . What I would prefer is to replicate this PHP example of function simpleEncrypt($message, $key) into Libsodium.js. But as a starter, I'd be happy even getting the basic sample from the Libsodium.js repo to work. Any hints? Here is the code (also shown in the working fiddle): const _sodium = require("libsodium-wrappers"); const concatTypedArray = require("concat-typed-array"); (async () => { await _sodium

Simple Javascript encryption using Libsodium.js in this sandbox demo

守給你的承諾、 提交于 2019-12-02 00:15:15
问题 I've spent an embarrasing number of hours trying to get Libsodium.js to work. See my fiddle demo (and code pasted below too). I keep getting Error: wrong secret key for the given ciphertext . What I would prefer is to replicate this PHP example of function simpleEncrypt($message, $key) into Libsodium.js. But as a starter, I'd be happy even getting the basic sample from the Libsodium.js repo to work. Any hints? Here is the code (also shown in the working fiddle): const _sodium = require(

Libsodium “Call to undefined function sodium_randombytes_buf” [closed]

对着背影说爱祢 提交于 2019-12-02 00:09:56
Trying to follow the examples here , but it gives me Fatal error: Uncaught Error: Call to undefined function sodium_randombytes_buf() On top of that, the key pairs seems to be generating weird strings like: kÿòjƒFDú{î—4]F◊î¸˜ßˆu…®_•A∞+ . Is that normal? Here's my code <?php // send $message = 'Hi, this is Alice'; $alice_to_bob_kp = sodium_crypto_box_keypair_from_secretkey_and_publickey( file_get_contents('./keys/sec-user-1_box_key.txt'), file_get_contents('./keys/pub-user-2_box_key.txt') ); $nonce = sodium_randombytes_buf(SODIUM_CRYPTO_BOX_NONCEBYTES); $ciphertext = sodium_crypto_box(

How to use nonces in asymmetric encryption (libsodium)?

微笑、不失礼 提交于 2019-12-01 04:16:38
I am writing an app where users can communicate between devices with end to end encryption. For this I use the libsodium encryption library. The asymmetric encryption function, crypto_box(...) requires a nonce as one of the arguments. I am a bit confused about how to handle nonces. Does every message to one person need to be encrypted using different nonces? This does not seem right since I would have to store the used nonces on a server with public access where an attacker could just use one of the used nonces again. Is it enough that all messages sent from A to B have different nonces or can

How to use nonces in asymmetric encryption (libsodium)?

…衆ロ難τιáo~ 提交于 2019-12-01 01:54:45
问题 I am writing an app where users can communicate between devices with end to end encryption. For this I use the libsodium encryption library. The asymmetric encryption function, crypto_box(...) requires a nonce as one of the arguments. I am a bit confused about how to handle nonces. Does every message to one person need to be encrypted using different nonces? This does not seem right since I would have to store the used nonces on a server with public access where an attacker could just use one

Howto patch/shim crypto.getRandomValues for React Native

扶醉桌前 提交于 2019-11-29 12:08:32
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 rewrite imports. Reimplementations of node // libraries such as `assert`, `buffer`, etc. will be picked up // automatically by the React Native packager. All other built-in node // libraries get rewritten to their browserify counterpart. [require('babel-plugin-rewrite-require'), { aliases: { crypto: 'crypto-browserify', // ... },

Howto patch/shim crypto.getRandomValues for React Native

时光毁灭记忆、已成空白 提交于 2019-11-28 06:03:39
问题 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 rewrite imports. Reimplementations of node // libraries such as `assert`, `buffer`, etc. will be picked up // automatically by the React Native packager. All other built-in node // libraries get rewritten to their browserify counterpart. [require(

android eclipse jedisct1/libsodium where to start

不羁的心 提交于 2019-11-28 03:40:34
问题 I have a program that needs to execute a libsodium encryption. I found this library libsodium but I think it needs to be used with NDK. And so I started to read tutorials about NDK but I still don't know where to start on using this library. If someone could give a hint or very useful stuff to give an idea on how to integrate this library, I would be so happy. Thanks 回答1: To integrate libsodium into your Android app, you need: The libsodium library compiled for your Android platform(s) A JNI