Currently, the demo uses Base64 encoded byte array to swap the encrypted message between the "server" and "client". And directly uses the iv as the prefix in the cryptogram.
We would prefer to use the JWE format instead for communication. We had some trouble with this and there has been an updated release and suggestion by the Nimbus team.
See https://bitbucket.org/connect2id/nimbus-jose-jwt/issues/490/jwe-with-shared-key-support-for-android#comment-64115045
Criteria:
-- Test the idea out
-- Leave feedback to the Nimbus team