Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/arxiver/rsam

Modified package for RSA encryption/decryption to allow large message encryption/decryption, to allow encryption through private key and decryption through public key and signature through public key and private key and vice versa. i.e. Additional functionalities to the existing crypto package https://pkg.go.dev/github.com/gossl/rsam
https://github.com/arxiver/rsam

crypto cryptography go go-package golang gopher package rsa rsa-algorithm rsa-encryption rsa-key-encryption rsa-key-pair

Last synced: 1 day ago
JSON representation

Modified package for RSA encryption/decryption to allow large message encryption/decryption, to allow encryption through private key and decryption through public key and signature through public key and private key and vice versa. i.e. Additional functionalities to the existing crypto package https://pkg.go.dev/github.com/gossl/rsam

Awesome Lists containing this project

README

        

# rsa-modified (rsam)

Supports additional functionalites and important stuff must be done in some corner cases and some specific applications

Modified package for RSA encryption and decryption to allow **large** message encryption and decryption and to **allow encryption through private key and decryption through public key** and signature through public key and private key and vice versa. i.e. Additional functionalities to the existing crypto package

### Installation

```shell
go get "github.com/gossl/rsam"
```

### Usage

```go
import (
"bytes"
"fmt"

"github.com/gossl/rsam"
)

func main(){
priv, pub, err := rsam.GenerateKeyPair(2048)
if err != nil {
panic(err)
}
msg := []byte("hello world")
ciphertext, err := rsam.EncryptWithPrivateKey(msg, priv, sha256.New())
if err != nil {
panic(err)
}
plaintext, err := rsam.DecryptWithPublicKey(encrypted, pub, sha256.New())
if err != nil {
panic(err)
}
if !bytes.Equal(msg, plaintext) {
panic(nil)
}
}
```