terl / lazysodium-android

An Android implementation of the Libsodium cryptography library. For the lazy dev.
https://github.com/terl/lazysodium-java/wiki
Mozilla Public License 2.0
108 stars 25 forks source link

Encrypt/Decrypt without nonce #11

Closed yleyvag closed 6 years ago

yleyvag commented 6 years ago

There's any way I can use lazysodium with asymetric encryption without handling the anoying nonces? It's called Authenticated Encryption.

gurpreet- commented 6 years ago

I don't believe there is a way to use authenticated encryption without a nonce. Lazysodium could generate the nonce for you but people may want to provide their own method of generating randomised nonces, so therefore Lazysodium doesn't handle them.

If it's any reconciliation, you can store the nonce in a public place. Or even alongside the encrypted text separated by a delimiter like # for example.