【问题标题】:How to use NaCl Encryption for Threema-API in C#?如何在 C# 中为 Threema-API 使用 NaCl 加密?
【发布时间】:2016-04-10 20:20:26
【问题描述】:

我想为内部工具编写一个 C# Threema API。

这里是 API: https://gateway.threema.ch/en/developer/api

它说,对于端到端加密,必须有 NaCl 加密,当我理解正确时 - API 是一个 webAPI,它需要:

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

那么如何加密这些数据呢?当然,我可以为 nonce 生成一个 24 字节长的十六进制编码字符串,但是如何在 c# 中使用该 nonce 加密文本?

【问题讨论】:

    标签: c# encryption nonce nacl-cryptography


    【解决方案1】:

    与此同时,Threema 提供了一个 .NET 版本的网关 SDK:Threema Message API .NET

    否则,您应该查看用于在 Threema 中加密消息的 libsodium 库。例如,libsodium-net 提供了加密所需的所有工具。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2021-11-13
      • 1970-01-01
      • 1970-01-01
      • 2014-03-01
      • 1970-01-01
      • 2012-11-19
      • 1970-01-01
      相关资源
      最近更新 更多