Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/dayanfreitas/rsa

Simple implementation of the RSA algorithm
https://github.com/dayanfreitas/rsa

coverage decoding docker docker-compose rsa-algorithm ruby testunit

Last synced: about 1 month ago
JSON representation

Simple implementation of the RSA algorithm

Awesome Lists containing this project

README

        

![example workflow](https://github.com/Dayanfreitas/RSA/actions/workflows/main.yml/badge.svg)


# RSA
Simple implementation gem of the RSA algorithm. Just academic reasons.

## Key generation private and public
```bash
# key generation
RSA.generated
```
## Encode
```bash
# encode
RSA.encode('oi')
```
## Decode
```bash
# decode
RSA.decode(RSA.encode('oi'))
```

## User keys open
```ruby
## For encoding

RSA::OPEN::Public.n=
RSA::OPEN::Public.e=
RSA.encode('oi')

## For decoding
RSA::OPEN::Private.n =
RSA::OPEN::Private.d =
RSA.decode(RSA.encode('oi'))
```

## Examples of implementation
Example folder. Intended for example using this gem

* Simple
Simplest way would be through ```RSA.generated```. That way you will have the keys created in the ```keys``` folder and you can use

* Open keys

You can use open keys, for those not generated through ```RSA.generated``` that way you can set externally.

# Development

## init
make up

## run teste
ruby test/all_test.rb

***

# To learn more about:
* [🔒 RSA implementation algorithm [PT-BR🇧🇷]](https://github.com/Dayanfreitas/RSA/blob/master/doc/rsa_algorithm_pt_br.md)