Skip to content

Instantly share code, notes, and snippets.

View yifeiwu's full-sized avatar
gitting gud

Yifei Wu yifeiwu

gitting gud
View GitHub Profile
@rpivo
rpivo / index.md
Last active March 18, 2024 05:03
Encrypting & Decrypting Sensitive Data With the Web Crypto API

Encrypting & Decrypting Sensitive Data With the Web Crypto API

Chris Veness created a really great gist that shares code to encrypt and decrypt data using the Web Crypto API here.

This gist breaks down the code in that gist step by step, detailing a real-world scenario with actual data.

It might be helpful to have that gist open in another tab and use this gist to walk through each line of code.

One interesting use case for this would be to encrypt on a client, and then decrypt in the cloud with something like a Lambda function. In order to do this, you could use Node's latest version as of this gist, version 15, which includes a webcrypto module that's designed to be a Node implementation of the Web Crypto API. Lambdas can't use v15 by default -- however, you can create a custom Lambda layer that contains v15.

@lukestephenson-zendesk
lukestephenson-zendesk / ElasticSearch.scala
Last active June 18, 2020 00:22
Efficient Kafka Consumers workshop
package com.zendesk.zts.search
import com.typesafe.scalalogging.StrictLogging
import monix.execution.Scheduler.Implicits.global
import monix.eval.Task
import monix.execution.atomic.AtomicInt
import scala.concurrent.duration._
import scala.concurrent.Future