问题标签 [nacl-cryptography]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
3114 浏览

java - 如何在 Windows 下将 NaCl 与 Java 一起使用

我最近找到了Libsodium库,很高兴还有Bindings for Java。不幸的是,这些库似乎不适用于 Windows,因为它们是为其他系统开发的。

如何在 Windows 下使用库(如果可能)?Java 是否有任何替代库?

0 投票
0 回答
71 浏览

c# - GHI G400-S 板支持 NaCl netmf?

我有 GHI 的 G400-S Raptor。

在搜索 netmf C# 加密示例时,我偶然发现了 NaCl netmf 库(http://www.mountaineer.org/resources/tidbits/using-the-nacl-crypto-library/ )。netmf NaCl 库似乎是为登山板做广告的,想知道 netmf NaCl 库是否可以在 GHI G400-S 板上工作?

0 投票
1 回答
484 浏览

cryptography - Security implications of public nonce

I'm planning to use the crypto_box() functions of Nacl to encrypt messages as part of a client/server protocol. The server has to deal with multiple clients and each message from a client to the server is encrypted using the public key of the server and signed with the private key of the client.

The cypto_box() functions also require me to provide a nonce. The current message number could be used as a nonce–to my understanding, the nonce is necessarily known to an attacker who is capable of keeping track of how many messages were exchanged. Both, the client and server would then maintain a message counter and simply use the newest counter value as a nonce.

However, I must deal with the case where messages are reordered or lost. Therefore I'd send the nonce in plaintext alongside the encrypted message. As long as the same nonce is not used twice, I don't see any problems with this approach. Did I miss out on something?

0 投票
1 回答
171 浏览

javascript - 将 tweetNaCL-js 加密库添加到 CouchDB validate_doc 函数

我正在尝试使用公钥加密(tweetnacl)验证文档。我知道您可以添加 commonjs 模块来验证功能,但还没有。

当我这样做时,我得到了错误:

我想我必须以某种方式更改 tweetnacl 代码以将其解释为 commonjs 模块?

0 投票
2 回答
2839 浏览

encryption - libsodium 如何生成密钥对

对于libsodium 中的公钥加密和diffie - hellman,我通常通过生成 32 个随机字节来生成私钥randombytes_buf,然后使用crypto_scalarmult_base.

crypto_box_keypair使用生成密钥对(除了语法)有什么好处吗?或者这个功能基本上就是这样做的?

0 投票
0 回答
73 浏览

eclipse - 在 Ubuntu 上的 Eclipse 中创建 Nacl Cryptography 库项目

我想创建一个 NaCl 密码库的 Eclipse 项目。我已经使用网站上提到的命令安装了它,但我不知道如何正确地将所有这些文件包含在我的 eclipse 项目中,以便我可以使用它来开发自己的主要功能。

谁可以帮我这个事?githut 存储库位于 Nacl Github,项目安装详细信息可在Nacl Install获得

我对此完全陌生,因此不知道。如果您需要任何进一步的信息,请告诉我。

提前致谢。

0 投票
1 回答
985 浏览

cryptography - 如何将 libsodium 私钥转换为 OpenPGP 兼容的私钥包?

libsodium 是一个很棒的加密库,而 GnuPG 是一个很棒的密钥管理和签名软件。

GnuPG 最近发布了对 Ed25519 签名密钥的支持,并向IETF 提交了一份草案

我想通过我的 Web 应用程序通过 GnuPG 离线使用 Sodium 生成的密钥。这将使我不必每次签名时都用我的私钥信任服务器,而且我不必在我的客户端上使用特殊软件(即使我必须编写它),因为我已经拥有并且相信 GnuPG。

我该怎么做?如何将 libsodium 私钥转换为 OpenPGP 兼容的私钥包?

0 投票
0 回答
193 浏览

algorithm - 使用 NaCl 对新的加密算法进行基准测试

对于我的硕士论文,我必须实现一些新的 Cryptographic 函数,以便简要了解它们的性能。我在网上查了一下,似乎 NaCl 库就是为此目的而创建的。

更准确地说,我真的不需要获得独立于硬件的措施,我只需要对不同版本的实现的性能有一些了解。我已经按照http://nacl.cr.yp.to/的描述下载了存档,但此时我有点迷失了。实际上,我并不真正需要现有算法的实现(也许我只需要保留 AES 以便我可以有一个比较点),但我需要添加我已经实现的新算法。这些实现是 C 代码。

在网站上,解释了如何通过编写新实现进行协作,但我不太确定我是否了解如何添加新算法。

有人可以通过给我一个教程链接或告诉我我需要修改什么来仅衡量我的实现来帮助我吗?

先感谢您

0 投票
1 回答
606 浏览

c# - 如何在 C# 中为 Threema-API 使用 NaCl 加密?

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

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

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

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

0 投票
2 回答
1323 浏览

java - 无法使用“Libsodium-net”(C#)打开由 TweetNacl(Java)生成的“SecretBox”

我在使用 libsodium-net 库在 C# 中打开 Nacl SecretBox(使用 TweetNaclFast 库在 java 中生成)时遇到问题。我也不能反过来(使用 TweetNaclFast 打开一个 libsodium-net 生成的框)。

在下面的示例中,我将使用 TweetNaclFast (Java) 创建一个 SecretBox,并尝试使用 libsodium-net (C#) 打开它

创建 SecretBox (Java)

创建输出

打开 SecretBox (C#)

打开输出

关于我可能做错了什么的任何想法?


编辑

我想问题出在其中一个库(最有可能是 libsodium-net)上。如果我用相同的变量创建一个 SecretBox,我会得到一个不同的盒子......

使用 TweetNaclFast 创建一个秘密盒子

返回:yDCt/kOLFUWPZpV3deVNUZaH0ZHLVmj9Nvm8QlbVKPe1a/INDw==

使用 libsodium-net 创建一个秘密盒子

返回:AAAAAAAAAAAAAAAAAAAAAMgwrf5DixVFj2aVd3XlTVGWh9GRy1Zo/Tb5vEJW1Sj3tWvyDQ8=