[B] serve as a method to generate public and private data encryption keys. The public key is used to encode user data such that user information is not humanly understandable and thus protected. The private key is used to decode user data when the user would like to access their data using a web application.
[A] String Snippet to encode:
Did you know that a blob object is composed of an arrayBuffer. And, a file object is composed of a blob object. So, when one makes a blob out of a .csv or an audio file, one is essentially converting the string characters into ASCII and making a long array out of it (called an arrayBuffer).
[B] Generate a pair of public and private data encryption keys in JSON Web Key format:
The public and private keys are generated using the Rivest–Shamir–Adleman algorithm https://www.w3.org/TR/WebCryptoAPI/#rsa-oaep-params. The algorithm settings used to generate these keys were: {name: "RSA-OAEP", modulusLength: 2048, publicExponent: new Uint8Array([0x01, 0x00, 0x01]), hash: {name: "SHA-256"}}, true, ["encrypt", "decrypt"]. These settings are important to know for importing the key in GitHub Actions.
GitHub Secrets: Copy the public and private JSON Web Keys and manually put them in GitHub Secrets. The public JSON Web Key is used to encode data and the private JSON Web Key is used to decode data. Manually storing the public and private data encryption keys on the GitHub server, using GitHub Secrets, is a secure way to use the keys and thus protect user information.
GitHub Actions: Use these keys in GitHub Actions, where GitHub Secrets are only accessable, to encode and decode data securely! For more information about using GitHub Secrets in GitHub Actions, please see: https://docs.github.com/en/rest/actions/secrets?apiVersion=2022-11-28