mfbmina.dev

by Matheus Mina

Automating tasks with Go

As developers, we often come across monotonous, repetitive tasks, and the thought of how we can automate them always comes to mind. Here at Trybe, we have two really cool scenarios where Go helped us automate some of these tasks.

First scenario

trybe-cli

The first scenario is our trybe-cli. That’s right, we wrote a client in Go to help our developers perform repetitive tasks with a few commands. Currently, our CLI allows us to:

RSA in Ruby for beginners

RSA is a public/private encryption algorithm and it is based on the difficulty of the factorization of the product of two large prime numbers. It was named after its creators Rivest, Shamir, and Adleman.

It is an expensive algorithm, computationally speaking, and because of this, it is not common to use it directly, but it is still widely used in the market and is one of the most important encryption algorithms. As an example, OpenSSL implements this algorithm for generating keys and it is commonly used for encrypting SSL certificates or SSH keys.

Implementing the Caesar Cipher in Ruby

Caesar cipher is the simplest and most widely known encryption technique. It is also known as Caesar’s cipher, shift cipher, Caesar’s code, Caesar shift, or ROT N (ROT13 is the most famous one, shifting letters by 13).

It is very simple because it just works for letters between A and Z, ignoring all special characters, such as dots, whitespaces, question marks, and special letters, like Ç or Á.

Show me the code!

Starting our implementation, we need to create a class that will know what we want to cipher and how many rotations we will do.