WasmEdge / WasmEdge

WasmEdge is a lightweight, high-performance, and extensible WebAssembly runtime for cloud native, edge, and decentralized applications. It powers serverless apps, embedded functions, microservices, smart contracts, and IoT devices.
https://WasmEdge.org
Apache License 2.0
8.48k stars 765 forks source link

Feat: Support Wasm-Signature proposal #344

Open hydai opened 3 years ago

hydai commented 3 years ago

Motivation

The wasm-Signature proposal is specifically about embedded digital signatures in WebAssembly modules, not about package/OCI signatures. When distributing WebAssembly modules, it will be nice if we can have a way to verify.

To achieve this target, we choose a Wasm-Signature proposal as our implementation standard. With this proposal, WasmEdge can provide sign and verify features.

Specification

  1. Follow the Spec of Wasm-Signature proposal.
  2. Please use the Options (b) Sign all bytecode preceding the “signature” Section as our solution.
  3. Implement the sign and verify features in the WasmEdge command line tool.
  4. Add unit tests and coverage to the related functions.
  5. Create a demo kit:
# Sign
wasmedge sign --key signerkey.pem --output signed-module.wasm input-module.wasm
# Verify
wasmedge verify --key signerkey.pub.pem signed-module.wasm
# Return 0 if ok, otherwise, return 1 with error messages

Appendix

  1. Wasm-Signature: https://github.com/wasm-signatures/design
  2. Existed tool, WasmSign: https://github.com/jedisct1/wasmsign
  3. Existed tool, wasm-sign: https://github.com/frehberg/wasm-sign
spider0061 commented 3 years ago

@hydai Hello, I wanted to say that I am interested in this project. In past I have worked as a GSoC student developer in 2020 where I worked on building a configuration wizard. Also, I have been an Amazon intern where I worked on AWS, React and Java. Other than this I am a proficient developer in C/C++ and Python. Currently I am looking to learn more and grow my tech stack. I just wanted to know what can be the starting point to learn more about WASM. Thanks

hydai commented 3 years ago

Hi @spider0061 For Wasm beginners, I believe the best document is https://developer.mozilla.org/en-US/docs/WebAssembly This website contains basic concepts and tutorials which are good and clear to developers.

Also, if you want to dig into Wasm, you can check https://webassembly.org/ for the spec.

anonymousr007 commented 3 years ago

Hi @hydai , I am Rishabh final year computer engineering student and proficient in C++ and Data Structures and Algorithms. I am interested in this project.I would like to work in this project. Thanks