Implementation of the Web Cryptography specification in Rust.

Overview

[wip] webcrypto

Implementation of the Web Cryptography specification in Rust.

This crate hopes to ease interoperability between WASM and native targets.

If you are a browser or just a random person whose in a looking-to-port-JS-code-but-don't-know-how-to-do-that-with-existing-crates-in-the-Rust-ecosystem situation? This crate is for you.

Usage

Unlike WebCrypto, the crate gives you the resposibility of storing raw keying material. This is wrapped in the opaque KeyMaterial wrapper type to avoid leakages through bad API usage or backtrace. You should carefully choose how you store the KeyMaterial depending on your use case.

/// A simple KeyMaterial storage impl
pub struct InMemoryVault(Vec<KeyMaterial>);

impl KeyStorage for InMemoryVault {

  /// This will be the _hidden_ handle to a `CryptoKey`
  /// In future, this will be required to be serde
  /// serializable.
  type Handle = usize;

  /// Put opaque key material into your backend and return
  /// a handle.
  fn store(&mut self, key: KeyMaterial) -> usize {
    self.0.push(key);
    self.0.len() - 1
  }

  /// Get opaque key material
  fn get(&self, handle: usize) -> Option<&KeyMaterial> {
    self.0.get(handle)
  }
}
You might also like...
Ursa - Hyperledger Ursa is a shared cryptography library

HYPERLEDGER URSA Introduction Features Libursa Libzmix Dependencies Building from source Contributing Introduction Ursa was created because people in

Traits - Collection of cryptography-related traits

RustCrypto: Traits Collection of traits which describe functionality of cryptographic primitives. Crates Name Algorithm Crates.io Docs MSRV aead Authe

A down-to-the-metal ongoing cryptography challenge designed by Radical Semiconductor.

woodpecker ðŸŠķ [NOTE: scoreboard will now be updated weekends, starting the weekend of 12/10/2022--sorry for delays! I'll also be merging in pull reque

Elliptic curve cryptography on Soroban.

Elliptic Curve Cryptography on Soroban Contract examples and reusable primitives. Groth 16 verifier. This crate provides a SorobanGroth16Verifier obje

A simple frontend web app in the seed.rs Rust framework.

Seed Quickstart Basic Rust-only template for your new Seed app. 1. Create a new project You can use cargo generate to use this template. $ cargo gener

A blazingly fast, ShareX uploader coded in Rust (using actix web) which utilizes AES-256-GCM-SIV to securely store uploaded content.

Magnesium Oxide ❔ What is this? Magnesium-Oxide (MGO) is a secure file uploader with support for ShareX. 🌠 Features ðŸ”Ĩ Blazingly fast uploads and enc

egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native
egui: an easy-to-use immediate mode GUI in Rust that runs on both web and native

🖌 egui: an easy-to-use GUI in pure Rust 👉 Click to run the web demo 👈 egui is a simple, fast, and highly portable immediate mode GUI library for Ru

Benchmarks of most widely used web frameworks built in rust.
Benchmarks of most widely used web frameworks built in rust.

Rust framework benchmarks Benchmarking utility to test the performance of all the rust web frameworks. Built with rust 🚀 . Demo (Last updated: Thu Ju

Web scraper written in Rust for extracting paid HTML templates for free.

HTML Template Scraper This tool provides a convenient solution by allowing you to access and download a wide range of HTML website templates, includin

Owner
Divy Srivastava
17 | Contributing to @denoland. Rust, Go and Typescript. Available for freelance. DON'T SEND ME CRYPTO JOB EMAILS
Divy Srivastava
An implementation of the append-only log described in the Certificate Transparency specification (RFC 6962)

CT Merkle This is an implementation of the append-only log described in the Certificate Transparency specification (RFC 6962). The log is a Merkle tre

Michael Rosenberg 30 Dec 2, 2022
Mundane is a Rust cryptography library backed by BoringSSL that is difficult to misuse, ergonomic, and performant (in that order).

Mundane Mundane is a Rust cryptography library backed by BoringSSL that is difficult to misuse, ergonomic, and performant (in that order). Issues and

Google 1.1k Jan 3, 2023
Pairing cryptography library in Rust

bn This is a pairing cryptography library written in pure Rust. It makes use of the Barreto-Naehrig (BN) curve construction from [BCTV2015] to provide

Electric Coin Company Prototypes and Experiments 139 Dec 15, 2022
Pairing cryptography library in Rust

bn This is a pairing cryptography library written in pure Rust. It makes use of the Barreto-Naehrig (BN) curve construction from [BCTV2015] to provide

Parity Technologies 23 Apr 22, 2022
Collect libraries and packages about cryptography in Rust.

Awesome Cryptography Rust Collect libraries and packages about cryptography in Rust. Collection Library Symmetric Public-key / Asymmetric One-way Hash

Rust Cryptography Community 282 Dec 25, 2022
A general solution for commonly used crypt in rust, collection of cryptography-related traits and algorithms.

Crypto-rs A general solution for commonly used crypt in rust, collection of cryptography-related traits and algorithms. This is a Rust implementation

houseme 4 Nov 28, 2022
Manage secret values in-repo via public key cryptography

amber Manage secret values in-repo via public key cryptography. See the announcement blog post for more motivation. Amber provides the ability to secu

FP Complete 82 Nov 10, 2022
Cryptography-related format encoders/decoders: PKCS, PKIX

RustCrypto: Formats Cryptography-related format encoders/decoders: PKCS, PKIX. Crates Name crates.io Docs Description base64ct Constant-time encoder a

Rust Crypto 112 Dec 20, 2022
Cryptography-oriented big integer library with constant-time, stack-allocated (no_std-friendly) implementations of modern formulas

RustCrypto: Cryptographic Big Integers Pure Rust implementation of a big integer library which has been designed from the ground-up for use in cryptog

Rust Crypto 88 Dec 31, 2022
BLS12-381 cryptography using Apache Milagro

BLS12-381 Aggregate Signatures in Rust using Apache Milagro WARNING: This library is a work in progress and has not been audited. Do NOT consider the

Sigma Prime 21 Apr 4, 2022