Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/arxiver/rsam
- Owner: arxiver
- License: mit
- Created: 2022-03-09T12:14:34.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2022-09-13T09:54:34.000Z (about 2 years ago)
- Last Synced: 2024-05-21T08:59:47.479Z (6 months ago)
- Topics: crypto, cryptography, go, go-package, golang, gopher, package, rsa, rsa-algorithm, rsa-encryption, rsa-key-encryption, rsa-key-pair
- Language: Go
- Homepage:
- Size: 39.1 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- Funding: .github/FUNDING.yml
- License: LICENSE
- Code of conduct: CODE_OF_CONDUCT.md
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)
}
}
```