This is a very simple Go implementation of the RSA algorithm that I've made while studying this awesome language. Feel free to check the code and do suggestions if you find something that can be improved. 🤘
You can build it as a regular Go program, there are no dependencies:
go build
There are basically three commands to check here: generate-profile
, encrypt
and decrypt
.
You have to start creating a profile for encryption:
./my-rsa generate-profile --size 4
It will print a key with 6 pieces used to encrypt and decrypt messages.
With a profile in hands, you can encrypt messages by calling the command encrypt
:
./my-rsa encrypt "A simple message" --profile xxx-xxx-xxx-xxx-xxx-xxx
The result will be an encrypted message that can only be decrypted with the profile string.
The decryption process is identical to the previous, so you just have to pass the encrypted message instead of the plain text:
./my-rsa encrypt "d;´129u /sas/g34" --profile xxx-xxx-xxx-xxx-xxx-xxx
It will print your message back!
The MIT License (MIT). Please see License File for more information.