This repository is a golang implementation of the textbook RSA encryption.
DO NOT USE THIS REPO IN PRODUCTION ENVIRONMENTS!
go get github.com/DiscreteTom/rawrsa
See the example code.
Structures:
type RawRsa struct {
rsa.PrivateKey
}APIs:
func NewRawRsa(random io.Reader, bits int) (*RawRsa, error)
func (rr *RawRsa) RawEncrypt(secretMsg *big.Int) (ciphertext *big.Int)
func (rr *RawRsa) RawDecrypt(ciphertext *big.Int) (secretMsg *big.Int)
func (rr *RawRsa) Save(fileName string) error
func Load(fileName string) (*RawRsa, error)