2

I am using libsodium on an embedded device. I would like to interact with mobile devices for keygen/encryption/decryption.

Is it necessary to use libsodium on all devices taking part in the encrypted communication?

To put it another way: libsodium wraps NaCl, so Is it then possible to use the native encryption functionality wrapped by libsodium or included in NaCl on the remote platform (Android or iOS) without actually including the libsodium libraries, or is this just asking for trouble?

I also have mbed TLS available on the embedded device. Is there a basic common encryption method that could be recommended for encrypted communication between device <--> Android and device <--> iOS ?

Thanks!

2 Answers2

2

Libsodium is a standalone library. It doesn't wrap any other libraries.

It is cross-platforms, so you can use it to communicate between your embedded device and iOS/Android. Everything it supports on one system will work the same way on another system.

If you are looking for something with a smaller memory footprint, you may want to use libhydrogen instead.

Frank Denis
  • 1,475
  • 9
  • 12
1

Lib-sodium is good library to communication encryption. Eventually you are calling NaCl method.

If you comfortable with native calling like c or c++ you can use.

I had used lib sodium library in Android application for server and device to device communication.

#Update Android library git link Libsodium Android

Gradle plugin implementation 'com.github.joshjdevl.libsodiumjni:libsodium-jni-aar:1.0.8'

Jarvis
  • 1,714
  • 2
  • 20
  • 35
  • Where did you obtain a lib-sodium library for Android? For example, https://download.libsodium.org/libsodium/releases/ doesn't seem to have Android libraries. – LarsH Jun 07 '18 at 20:00
  • 1
    Edited my answer check now – Jarvis Jun 08 '18 at 06:33
  • Thanks, this worked for me! I used `implementation 'com.github.joshjdevl.libsodiumjni:libsodium-jni-aar:2.0.0'` in build.gradle. (I also had to remove `android:allowBackup="true"` from the autogenerated `AndroidManifest.xml`.) – LarsH Jun 12 '18 at 20:56