Documentation
¶
Overview ¶
A Public key cryptosystem based on eighter discrete logarithms or elliptic curves. This Package implements a fully integrated Public Key System. Every Keypair can be used for both, signatures and encryption. The Encryption is done using a simple Diffie-Hellman-Scheme with symetric cipher. The signature scheme is based on Schnorr's signature (see https://en.wikipedia.org/wiki/Schnorr_signature ).
For Encryption, the cipher Twofish ist used in 256-bit mode. For Hashing (Schnorr signature) BLAKE2b is used, where BLAKE2b is used as keyed MAC.
Index ¶
- Constants
- func Decrypt(priv *PrivateKey, src io.Reader) (io.Reader, error)
- func Encrypt(pub *PublicKey, r io.Reader, dest io.Writer) (io.WriteCloser, error)
- func GenerateKeyPair(group ObjectID, r io.Reader) (*PublicKey, *PrivateKey, error)
- type ErrorCode
- type Group
- type ObjectID
- type PrivateKey
- type PublicKey
- type Signature
- type Signer
- type Verifier
Constants ¶
const ( EInvalidGroup = ErrorCode(iota) EHeaderTooBig EGroupMismatch )
const ( /* ModP groups (see RFC-3526) */ Modp5 = Group(iota) /* 1536-bit MODP Group */ Modp14 /* 2048-bit MODP Group */ Modp15 /* 3072-bit MODP Group */ Modp16 /* 4096-bit MODP Group */ Modp17 /* 6144-bit MODP Group */ Modp18 /* 8192-bit MODP Group */ /* Curves ... */ FIPS_P224 /* P-224 (see FIPS 186-3, section D.2.2) */ FIPS_P256 /* P-256 (see FIPS 186-3, section D.2.3) */ FIPS_P384 /* P-384 (see FIPS 186-3, section D.2.4) */ FIPS_P521 /* P-521 (see FIPS 186-3, section D.2.5) */ Koblitz_S160 /* secp160k1 (see SEC 2 section 2.4.1) */ Koblitz_S192 /* secp192k1 (see SEC 2 section 2.5.1) */ Koblitz_S224 /* secp224k1 (see SEC 2 section 2.6.1) */ Koblitz_S256 /* secp256k1 (see SEC 2 section 2.7.1) */ /* Brainpool Curves. (Non-NSA curves) */ Brainpool_P160r1 Brainpool_P160t1 Brainpool_P192r1 Brainpool_P192t1 Brainpool_P224r1 Brainpool_P224t1 Brainpool_P256r1 Brainpool_P256t1 Brainpool_P320r1 Brainpool_P320t1 Brainpool_P384r1 Brainpool_P384t1 Brainpool_P512r1 Brainpool_P512t1 /* Complex number groups, see github.com/maxymania/complexdh */ Complex_2048bit Complex_4096bit Complex_8192bit )
Variables ¶
This section is empty.
Functions ¶
func GenerateKeyPair ¶
Types ¶
type PrivateKey ¶
func (*PrivateKey) PublicKey ¶
func (priv *PrivateKey) PublicKey() *PublicKey
Generates the Public Key from the Private Key. This is useful, if the user lost his Public Key. If the operation is not supported, the method shall return nil.