Implementing RSA Encryption and Signing in Golang (With Examples)

This post will describe what the RSA algorithm does, and how we can implement it in Go. RSA (Rivest–Shamir–Adleman) encryption is one of the most widely used algorithms for secure data encryption. It is an asymmetric encryption algorithm, which is just another way to say “one-way”. In this case, it’s easy for anyone to encrypt a piece of data, but only possible for someone with the correct “key” to decrypt it....

 · Soham Kamani

Functional Options in Go: Implementing the Options Pattern in Golang

This post talks about what functional options are in Go, and how we can use the options pattern to implement them. Functional options take the form of extra arguments to a function, that extend or modify its behavior. Here’s an example which uses functional options to create a new House struct: h := NewHouse( WithConcrete(), WithoutFireplace(), ) Here, NewHouse is a constructor function. WithConcrete and WithFireplace are options passed to the constructor to modify it’s return value....

 · Soham Kamani