ownrsa

package
v0.0.0-...-bb7f01f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 9, 2018 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ArrayIntToString

func ArrayIntToString(a []int, delim string) string

func Blind

func Blind(m []int, r int, pubK RSAPublicKey, privK RSAPrivateKey) []int

func BlindSign

func BlindSign(m []int, privK RSAPrivateKey) []int

func Decrypt

func Decrypt(c []int, privK RSAPrivateKey) string

func DecryptBigInt

func DecryptBigInt(bigint *big.Int, privK RSAPrivateKey) *big.Int

func DecryptInt

func DecryptInt(val int, privK RSAPrivateKey) int

func Encrypt

func Encrypt(m string, pubK RSAPublicKey) []int

func EncryptBigInt

func EncryptBigInt(bigint *big.Int, pubK RSAPublicKey) *big.Int

func EncryptInt

func EncryptInt(char int, pubK RSAPublicKey) int

func HomomorphicMultiplication

func HomomorphicMultiplication(c1 int, c2 int, pubK RSAPublicKey) int

func StringToArrayInt

func StringToArrayInt(s string, delim string) []int

func Unblind

func Unblind(blindsigned []int, r int, pubK RSAPublicKey) []int

func Verify

func Verify(msg []int, mSigned []int, pubK RSAPublicKey) bool

Types

type PackRSA

type PackRSA struct {
	PubK       string    `json:"pubK"`
	PrivK      string    `json:"privK"`
	Date       time.Time `json:"date"`
	PubKSigned string    `json:"pubKSigned"`
}

func PackKey

func PackKey(k RSA) PackRSA

type RSA

type RSA struct {
	PubK  RSAPublicKey
	PrivK RSAPrivateKey
}

func GenerateKeyPair

func GenerateKeyPair() RSA

func UnpackKey

func UnpackKey(p PackRSA) RSA

type RSAPrivateKey

type RSAPrivateKey struct {
	D *big.Int `json:"d"`
	N *big.Int `json:"n"`
}

type RSAPublicKey

type RSAPublicKey struct {
	E *big.Int `json:"e"`
	N *big.Int `json:"n"`
}

func PubKStringToBigInt

func PubKStringToBigInt(kS RSAPublicKeyString) (RSAPublicKey, error)

type RSAPublicKeyString

type RSAPublicKeyString struct {
	E string `json:"e"`
	N string `json:"n"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL