1

I want to write a C# Threema API for an internal tool.

Here is the API: https://gateway.threema.ch/en/developer/api

It says, for the end-to-end encryption there has to be a NaCl encryption, when I understand it right - The API is a webAPI which needs:

[nonce] nonce used for encryption (24 bytes, hex encoded)
[box] encrypted message data (max. 4000 bytes, hex encoded)

So how to encrypt this data? Of course I can have a 24byte long hex encoded string generated for the nonce, but how to encryt a text with that nonce in c#?

Rene Koch
  • 317
  • 3
  • 13

1 Answers1

0

In the meantime Threema has provided a .NET version of the Gateway SDK: Threema Message API .NET

Otherwise, you should look into the libsodium library which is used for encryption of the messages in Threema. There is for example the libsodium-net which provides all the tools needed for encryption.

SimMac
  • 479
  • 5
  • 16