Pinscope 背后的团队遇到了一个问题。他们需要一个 ESP32 来保持与服务器的安全连接,但由于其他各种原因,芯片上没有足够的备用 RAM 来运行 TLS。因此,他们想出了一个有用的变通方案,以便在没有 TLS 的情况下在 ESP32 上实现远程访问。
该团队指出,他们不需要TLS的一般功能。要知道,TLS非常适合使用证书安全地连接任何客户端和服务器,但当您使用的设备只需要连接到一台服务器进行维护时,TLS就显得有点繁琐了。团队决定,该设备只需要识别它是否在与真正的服务器通信,它必须确保凭据以加密方式通过线路发送,并且消息在传输过程中不应被重放、读取、重新排序或以其他方式更改。
Noise 协议解决了这个问题。具体而言,是 Noise_NK_25519_ChaChaPoly_SHA256,其中服务器使用设备预先知道的静态密钥。由于只有服务器私钥的持有者才能正确完成握手,因此设备知道它正在与真正的服务器通信,并且整个握手过程在 ESP32 上仅需 0.3 秒,通过线路发送的字节数仅为 100 字节。结果令人信服。ESP32 需要 23.6 KB 的 RAM 才能通过 TLS 保持连接,而使用 Noise 协议时,这一数字降至仅 9.4 KB。
如果您需要减轻远程连接的 ESP32 的负担,您可能会发现这项工作非常有用。好奇的朋友可以在 Github 上找到相关文件。


The team behind Pinscope had a problem. They needed an ESP32 to stay securely connected to a server, but they didn’t have enough spare RAM on the chip to do TLS, what with everything else going on. Thus, they whipped up a useful workaround to get remote access on an ESP32 without TLS.
The team noted they didn’t need the general functionality of TLS. See, TLS is great for connecting any client and server securely with certificates, but it’s a bit heavy when you’re working with a device that only needs to connect to one server for maintenance. The team decided the device just needed to ID whether it was talking to the real server, it must ensure credentials are sent over the wire encrypted, and messages should not be able to be replayed, read, reordered, or otherwise changed while in transit.
The solution to this problem was the Noise protocol. Specifically, Noise_NK_25519_ChaChaPoly_SHA256, where the server uses a static key which the device knows in advance. Since only the holder of the server’s private key can properly finish a handshake, the device knows it’s talking to the real server, and the entire handshake takes just 0.3 seconds on the ESP32, with just 100 bytes sent over the wire. The results are compelling. The ESP32 needed 23.6 KB of RAM to stay connected via TLS, while this dropped to just 9.4 KB using the Noise protocol.
If you need to lighten the burden on a remotely-connected ESP32, you might find this work very useful. Files are on Github for the curious.
本文来源:https://hackaday.com/2026/11/27/esp32-remote-access-done-light/
若有版权问题,请来信告知:13951431913#139.com 或在右方提交评论。