eccutil

command
v0.0.0-...-d86af7b Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2019 License: BSD-3-Clause Imports: 8 Imported by: 0

Documentation

Overview

Command eccutil is for working with elliptic curves.

Usage of ./eccutil:

  -decrypt
        decrypt the 'in' file to 'out', uses 'priv' key
  -encrypt
        encrypt the 'in' file to 'out', uses 'pub' key
  -in string
        input file (reads stdin by default)
  -newkeys int
        new key pair with bitsize [224,256,384,521]
        writes to 'pub' and 'priv' in PEM format
        if 'pass' is included the 'priv' key file will be encrypted
  -open
        opens the sealed 'in' file to 'out',
        uses 'pub' key of sender and 'priv' key of recipient
  -out string
        output file (writes stdout by default)
  -pass string
        password for private key file
  -priv string
        private key file in PEM format (default "private.pem")
  -pub string
        public key file in PEM format (default "public.pem")
  -seal
        seal the 'in' file to 'out',
        uses 'pub' key of recipient and 'priv' key of sender
  -sign
        reads a hash from 'in' in HEX format,
        writes signature to 'out' in HEX format, uses 'priv' key
  -verify
        reads a hash and signature from 'in' in HEX format,
        hash should be first and signature should be separated by whitespace,
        writes "verified" or "not verified" to 'out',
		uses signers 'pub' key

Some examples:

$ ./eccutil -newkeys 256
$ cat Walden.txt | ./eccutil -encrypt | ./eccutil -decrypt | diff Walden.txt -

$ ./eccutil -newkeys 256 -pass abc123
$ sha256sum Walden.txt > Walden.txt.sig
$ cat Walden.txt.sig | ./eccutil -sign -pass abc123 >> Walden.txt.sig
$ cat Walden.txt.sig
9c5f66219b07b9d836f11080711ab09c63137891063add39bc2eacccbab8bfda  Walden.txt
ffec8148f8627cf1b2f8412544f3e73f753ca0a66c901747333e0d8af587045dc995dbbaf3848aeae431d94562c35ea02387c57126f4b69c7bd11f65c1d72b28
$ cat Walden.txt.sig | ./eccutil -verify -pass abc123
Verification OK

$ ./eccutil -newkeys 521
$ ./eccutil -seal -in Walden.txt -out Walden.txt.sealed
$ ./eccutil -open -in Walden.txt.sealed -out Walden.txt.opened
$ diff Walden.txt Walden.txt.opened

Jump to

Keyboard shortcuts

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