What is the Difference between #PeculiarVentures 's `webcrypto` and `node-webcrypto-ossl`? - webcrypto

I'm the author of GUN and I love your work!
I'm a little bit confused about which libraries I should be using, or which ones depend on each other:
node-webcrypto-ossl
webcrypto
webcrypto-core
node-webcrypto-p11
Or any other ones I should know about.
Thanks!

webcrypto-core is a common layer library to be used by all webcrypto libraries for input validation. It doesn't implement any crypto providers. You can use this library if you want to implement own crypto provider.
#peculiar/webcrypto is WebCrypto API implementation based on NodeJS Crypto API. It's easy to install
node-webcrypto-ossl is NodeJS addon which implements WebCrypto API based on OpenSSL. Requires C++ tools for compilation.
node-webcrypto-p11 is WebCrypto API implementation based on PKCS#11
All these 3 crypto libraries are for NodeJS projects using. Requires PKCS#11 library.

Related

Is webcrypto subtle an abstraction on top of Node.js crypto APIs?

Evaluating security implications of refactoring from crypto to webcrypto to make codebase interoperable between browser and server.

How to integrate a 3rd party consensus pallet library compiled to WASM into substrate

I was playing around Substrate and I was wondering whether it is possible to integrate a 3rd party consensus library which I have compiled to WASM (Web Assembly) as a Pallet in substrate. I know it is possible to integrate smart contracts already compiled to WASM binaries into substrate runtime. My question was whether it is possible to integrate a different consensus pallet already compiled to WASM and how such an integration would interface with the Node (substrate node) RPC methods. Thanks in advance.

Library function that implements TPM2_MakeCredential

For remote attestation using a TPM, on the server-side I need the TPM2_MakeCredential function. Note that this function is implemented in the TPM but it is a bit off because it doesn't depend on any TPM state, it's completely stateless (unlike the TPM2_ActivateCredential function - to be run on the client-side - which critically depends on TPM keys). According to the documentation, it's provided as a convenience. That's OK but the problem is the server doesn't have (nor requires) a TPM. But I still want to use the TPM2_MakeCredential function.
Unfortunately, I haven't been able to find a library implementation of this function. There's a full-blown TPM2.0 emulator provided by Microsoft that the TPM.MSR libraries can interface to. This works, but it requires starting and managing the simulator process which sets up sockets etc. which I would rather avoid. I am wondering if there's a pure C/C++/C# implementation provided as a library? I have been working with various solutions but the function is not trivial to re-implement, and it's also not trivial to extract from the simulator.
It turns out the TPM.MSR library itself exposes this functionality (implemented purely in the library itself, not relying on a TPM) via the CreateActivationCredentials() function on TpmPublic.

How to use Telegram's TDlib with Node.js

There is TDlib which allows to work with Telegram Client API.
Documentation says that it's possible to use it with almost any language.
I can't imagine myself how I can use it with Node.js
Could you tell me where to start from or provide me with a sample code?
You can make requests and get updates using td_json_client and node-ffi interfaces. Official repository provides a simple example.
If you don't want to create API client from zero, you may use one of exists. For example, check out Airgram. This is a strong typed tdlib client for NodeJS.
You can probably port one of the examples on their GitHub repos (Python can be an easy one). You needs to learn how to use binary modules with node.
Or you can check one of the 3rd party libraries (eg. https://github.com/k-egor-smirnov/node-tg-native)
There are 2 active TDLib wrappers in Node.js:
https://github.com/airgram/airgram
https://github.com/Bannerets/tdl
Both require you to build the TDLib binary yourself before using these wrapper: https://tdlib.github.io/td/build.html

Is there a library what that implements pusher.com in node.js?

I use pusher.com and want to migrate to my own hosting. Is there a library that implements the Pusher.com protocol in Node.js?
Slanger is an open source implementation of the Pusher protocol written in Ruby; I'm not familiar with one written in Node. Note that the protocol is fairly documented, so if you really needed it for Node you could potentially write one.

Resources