merkel_hellman

package
v0.0.0-...-1c7d2e7 Latest Latest
Warning

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

Go to latest
Published: May 23, 2023 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BinaryToString

func BinaryToString(bits []byte) (string, error)

func Decrypt

func Decrypt(privKey *PrivateKey, c *big.Int) (message string, err error)

Fonction qui décrypte le message

func Encrypt

func Encrypt(pubKey *PublicKey, message string) (c *big.Int, err error)

Fonction qui encrypte le message

func GenerateCoprimes

func GenerateCoprimes(n *big.Int) (a *big.Int, b *big.Int, err error)

Fonction qui génère deux nombre premier

func GenerateKeyParameters

func GenerateKeyParameters(r []*big.Int, iterations int) (a []*big.Int, b []*big.Int, m []*big.Int, err error)

Fonction qui génère les paramétres des clefs publics et privées

func GenerateKeys

func GenerateKeys(byteSize uint, iterations int) (privKey *PrivateKey, pubKey *PublicKey, err error)

Fonction qui génrer les clefs publics et privées

func GenerateSuperIncreasingSequence

func GenerateSuperIncreasingSequence(n int) (r []*big.Int, err error)

fonction qui génère une suite supercroissante

func MulMod

func MulMod(r []*big.Int, a *big.Int, b *big.Int) (m []*big.Int)

Generates a sequence m where each element m[i] is calculated as r[i]*a mod b.

func StringToBinary

func StringToBinary(s string) ([]byte, error)

Types

type PrivateKey

type PrivateKey struct {
	R    []*big.Int
	A, B []*big.Int
}

type PublicKey

type PublicKey struct {
	M []*big.Int
}

Définission de type de données des clés publique et privées

Jump to

Keyboard shortcuts

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