问题标签 [sodium]
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.
c# - Switching streams in RX: Sodium's equivalent of merge and switch in RX
How can the television channel problem as explained in this talk at 31th minute be solved by RX ?
The problem expressed in Rx is as follows:
The are two television channels (channel1
and channel2
) which transmit a stream of images, plus a stream of fuzz
which represents no channel or white noise.
There are two buttons which send events eButton1
and eButton2
when they are pressed.
These button presses should result in the respective channels being sent to the screen.
Each button press should be projected (mapped) into the respective channel, and then all channels combined into a selection stream as stream of streams which starts with the fuzz
stream. Finally a switch operator sends the selected stream to the screen
.
Question
What is the equivalent of Sodiums'switch and merge in RX?
Is it possible to solve it with pure higher order functions ? I.e. without using closures ? I don't see how that would be possible.
system.reactive - RX 中的 Elm 信号(Conal 行为)等价物是什么?RX到底有没有这样的概念?
我正在观看这个视频(见下图),这让我想知道 Elm 的 Signal 是否与 Conal 的Behavior相同。
我认为它们是相同的,但我不是 100% 确定。他们是一样的吗?
这里有几个相关的问题:
1) RX 中的榆树信号(Conal 的行为)是什么?RX中到底有没有这样的概念?也许是重播主题?
2)如何将 RX Observable 转换为 RX 中的信号(行为)?在Sodium中,有用于此目的的保持功能。
3) Elm 中 RX 的 Observable 是什么(AFAIK RX 的 Observable 对应于 Conal 的事件)?榆树有这样的东西吗?
谢谢阅读。
以下是表格中表达的问题:
榆树谈话的快照:
java - 在 InteliJ IDEA 中调试 Java 期间生成的变量名中的美元符号是什么意思?是闭包吗?
在 InteliJ 中调试 Java 期间,变量名中的美元符号是什么意思?是闭包吗?请参阅下面的图像和代码片段。
这是 Stream 类的一部分:
我怀疑$1
inStream$1@915
指的是在上述方法中创建的闭包。不过我不确定。有人可以证实这一点吗?或者,如果不是这种情况,请解释生成的名称中美元符号的含义?
代码取自 Sodium Functional Reactive 库,我试图了解它是如何工作的。
c - 我怎样才能包括在 Visual Studio 中正确吗?
我在安装页面阅读了Compilation on Windows的部分,但我仍然很困惑,希望高手能赐教。
我LATEST.tar.gz
从这里下载。
之后,我复制sodium.h
并sodium
文件夹libsodium-1.0.12\src\libsodium\include
到我的项目中。
这是代码:
编译时出现这些错误:
错误 LNK1120 2 未解决的外部
函数 _main 中引用的错误 LNK2019 未解析的外部符号 __imp__randombytes_buf
函数 _main 中引用的错误 LNK2019 未解析的外部符号 __imp__randombytes_uniform
我没有收到像“无法打开 sodium.h”这样的错误。
我该如何解决这个问题?
任何帮助表示赞赏。
php - 使用私钥快速钠解密
我在客户端使用 Swift Sodium,因为我的服务器在通过 API 与我共享数据之前使用 libsodium 加密数据。
现在我有一个现有的私钥和一个字符串格式的公钥。我现在想在 iOS 上使用 Swift 解密加密数据。
如何使用我拥有的公钥和私钥生成 Sodium Key Pair?
另外理想情况下,我应该只使用私钥来解密数据。那么我如何只使用私钥作为字符串来做到这一点。
我的解密代码如下所示 -
在上面的代码中,我解密的字符串总是空的。
服务器正在使用以下功能加密数据 -
在服务器解密逻辑
php - 修复损坏的 libsodium php 安装 Ubuntu Xenial
libsodium 工作正常,但现在我设法破解它并且找不到如何破解它。
Amazon AWS Ubuntu Xenial,安装了 libsodium18,安装了来自 Ondrej Sury PPA 的 php-sodium,但现在我得到了:
未定义的常量'Sodium\CRYPTO_SECRETBOX_NONCEBYTES'
烦人的是它在 Zesty 中很好,但仍然没有稳定的 AWS Zesty 图像。我确定我刚刚忘记了一些简单的事情,但它刚刚停止工作。
javascript - libsodium 兼容性 PHP vs Javascript
我有一个通过 libsodium (sodium_compat) 库使用 RSA 加密的 PHP 代码。
我的脚本如下:
上面的脚本显示了我如何从已生成的密钥对中解密加密消息。
我想在 Javascript 端使用相同的密钥进行相同的解密以避免服务器过载,我发现这个库应该是相同的libsodium
该文档显示了如何解密如下:
我不明白如何使解密在 PHP 和 Js 中兼容,它们指的是使用 Js 中的密钥创建的随机数,但在 PHP 中,同一个库不提供。请问有什么帮助吗?
谢谢
ios - Swift-Sodium:标量乘法
我在我的项目中使用SwiftSodium ( https://github.com/jedisct1/swift-sodium ) 进行加密。
我需要执行公钥和私钥的标量乘法。
ScarMultiplication 包装类在libsodium .net版本中可用,但在 Swift (SwiftSodium) 中不可用。
关于如何实现标量乘法的任何帮助都是非常可观的。
谢谢。
php - php 7.2 Azure linux/fastcgi 中的钠可用性
经过一些阅读和示例,我一直在尝试libsodium
在Azure
网站中使用。
因为我读到自 7.2 以来钠将成为 php 核心的一部分,并且 php 站点显示
无需额外配置
尝试了 Windowsfastcgi
和Linux
phpinfo() 在它们两个中都显示了钠,但我不能使用它,如https://paragonie.com/book/pecl-libsodium/read/08-advanced.md#crypto-aead-aes256gcm中的示例,因为我得到的是
致命错误:未捕获错误:调用未定义函数 sodium_crypto_aead_aes256gcm_is_available()
谢谢大家的帮助