Skip to content

Instantly share code, notes, and snippets.

View osvalban's full-sized avatar

osvaldo banuelos osvalban

View GitHub Profile
@osvalban
osvalban / key_wrap.go
Created September 28, 2021 16:14
AES Key Wrapping with Golang
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/sha256"
"crypto/x509"
b64 "encoding/base64"
"fmt"
"io/ioutil"
@osvalban
osvalban / key-wrapping-aws-cloudhsm.md
Created September 21, 2021 22:00
Skyflow BYOK with AWS CloudHSM

Key Wrapping in AWS CloudHSM

This guide describes how to generate an AES key in AWS CloudHSM and encrypt it with a Skyflow-provided Wrapping Key. Key Wrapping is a common technique to store or transmit keys in insecure environments. Specifically, the produced key ciphertext is compatible with Skyflow's BYOK API. Prerequisites:

  • Active AWS CloudHSM Cluster
  • Amazon EC2 Instance connected to AWS CloudHSM Cluster
  • A crypto user (CU) authorized to perform key management and cryptographic operations in the HSM

If any prerequisite is not met, please stop here and consult [1] and [2].

1. Copy RSA Wrapping Key to EC2 Instance

Keybase proof

I hereby claim:

  • I am osvalban on github.
  • I am osvaldob (https://keybase.io/osvaldob) on keybase.
  • I have a public key ASDdcEOgOnkJ6MnJ_ada8D2Db15BERKUmgjmaytad4KSFAo

To claim this, I am signing this object: