twoway

package module
v0.0.0-...-4fb8611 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: MIT Imports: 2 Imported by: 0

README

twoway

A cryptographic scheme based on Pairing-based cryptography (bn256).

The scheme has a behavoir similar to RSA: In RSA, you can encrypt a message with the private key, that you can only decrypt with the public key. Furthermore, the keys look similar, as both public and private key consist of a large modulus and an exponent. Finally, in RSA, neighter the private key can be computed from the public key, nor the public key can be computed from the private key.

Here are some similarities to RSA.

  • The public key can't be computed from the private key
  • Encryption and Decryption works in both directions.
  • The owner of the private key can Encrypt messages, that can be decrypted using the public key.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Decrypt

func Decrypt(g1 *bn256.G1, g2 *bn256.G2) *bn256.GT

g1 and g2: one of them might be the "private key", the other one might be the message.

func EncryptWithG1

func EncryptWithG1(g1 *bn256.G1, r io.Reader) (*bn256.G1, *bn256.GT, error)

func EncryptWithG2

func EncryptWithG2(g2 *bn256.G2, r io.Reader) (*bn256.G2, *bn256.GT, error)

func GenKeyPair

func GenKeyPair(r io.Reader) (*bn256.G1, *bn256.G2, error)

Generates a Key-Pair (G1 and G2).

func Pair

func Pair(g1 *bn256.G1, g2 *bn256.G2) *bn256.GT

bn256.Pair(g1,g2)

func RandomGT

func RandomGT(r io.Reader) (*bn256.GT, error)

Types

This section is empty.

Jump to

Keyboard shortcuts

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