RSA Keys

Get a brief introduction to RSA keys with a code example.

Overview

A message authentication code is a good first step to ensure we can transfer data in a reliable way between two parties. Using an array of bytes as a secret key is not ideal. A JWS created by party A can be verified and altered by party B since they also have the same key. If we use an RSA key, we can ensure that no one else can create a signed message.

The RSA, or the Rivest-Shamir-Adleman, is a widely used asymmetric encryption algorithm that uses a key of 2048 or 4096 bits. RSA keys can perform fast and reliable encryption and decryption of a value and can also be used in the creation of a signature. Since the signature is created with the private ...