Commit graph

17 commits

Author SHA1 Message Date
Sudhi Herle
c4f79962c9 Updated dependencies; use SafeFile from go-utils. Teach tests.sh to use
a user supplied binary & tmpdir
2023-11-12 12:21:31 -08:00
Sudhi Herle
f343d45a8e Add sender authenticated message integrity; fixup KDF
- use HKDF for producing keys, nonces
- add running hmac of plaintext; sender-sign the hmac as trailer
- use header checksum as "salt" for data encryption keys, nonces
- generate explicit nonce for wrapping root keys for each recipient
  (previous impl had brittleness)
2022-11-13 11:53:00 -08:00
Sudhi Herle
0ddf48c92f Minor cleanups and one bugfix:
* bugfix: use os.IsNotExist() instead of comparing errors for equality;
  this fixes incorrect handling of missing authorized_keys file.
* move die() and warn() into die.go - and make them public functions.
* teach die.go to also provide atexit() like functionality
* teach all callers of sign.SafeFile{} to use AtExit() to delete
  temporary artifacts
* symbol renaming: die->Die, warn->Warn.
2022-05-12 16:53:27 -07:00
Sudhi Herle
42bbe5ddeb Refactored the core signing & encryption library, teach sigtool to use safe I/O.
* Added new SafeFile (io.WriteCloser) class + methods to atomically write a file.
* Teach core lib to use SafeFile for all file I/O
* Teach sigtool to use SafeFile for all file I/O
* Cleaned up the public interfaces of sign/ to be more coherent:
   - with uniform APIs for marshaling, unmarshaling, serialization.
   - removed KeyPair class/interface and stick to PrivateKey as the primary
     interface.
* collected common rand utility functions into rand.go
* Teach sigtool to NOT overwrite existing output files (keys, signatures etc.)
* Teach sigtool to use a new --overwrite option for every command that creates
  files (generate, sign, encrypt, decrypt)
* encrypt/decrypt will try to use the input file mode/perm where possible
  (unless input is stdin).
* Added more tests
2022-04-29 21:36:39 +05:30
Sudhi Herle
f82c1336ac sigtool now supports openssh ed25519 public and private keys.
* Added support to read openssh public keys and encrypted private keys
* reworked private key handling
* made password the default; generating keys without password
  requires explicit "--no-password"
2019-11-05 21:42:25 +01:00
Sudhi Herle
a27044154a Working version with enc/dec of all key types.
* Updated README
* fix non-ephemeral key wrap/unwrap
* fix out of bounds error in decrypt
2019-10-18 15:42:08 -07:00
Sudhi Herle
21445ba1a1 First working version of encrypt/decrypt
* use protobuf for encryption-header
* use fixed size file-header (42 bytes) before the encryption-header
* add encryption/decryption contexts
* teach MakePrivateKey() to fixup its internal public key bits
2019-10-17 14:29:01 -07:00
Sudhi Herle
9473c10bfd Added encrypt/decrypt commands to sigtool 2019-10-14 09:46:03 -07:00
Sudhi Herle
1cc55e1a55 WIP: added encryption key mgmt
* added encrypt, decrypt commands (empty now)
* use command abbreviation util library
* switched to go1.13 (ed25519 now in stdlib)
* added new code to convert/manage Ed25519 keys to Curve25519
  (thanks to FiloSottile/age)
2019-10-09 14:52:34 -07:00
Sudhi Herle
40a0c2d829 Teach sigtool to use go modules; updated to use my fork of pflag. 2019-06-20 10:51:33 +05:30
Sudhi Herle
15477d6197 Moved go-sign from external repo to this repo; updated README; added Makefile 2018-10-18 17:10:29 +09:00
Sudhi Herle
2f95f63964 Refactor sigtool to use pflag instead of go-options. 2018-05-01 23:59:19 -05:00
Sudhi Herle
7015d03394 Fixed import paths due to go-lib restructuring; updated with gofmt. 2018-02-28 22:01:01 -06:00
"sudhi@herle.net"
7e84c64397 Add a check for incorrect public key. 2016-10-27 13:52:17 -07:00
"sudhi@herle.net"
7bf1e55204 Updated README with examples; removed non-functional "no-serialize" 2016-10-27 13:40:39 -07:00
"sudhi@herle.net"
dc86cede20 v1.0 2016-10-06 22:06:41 -07:00
"sudhi@herle.net"
0df9416271 Exp 2016-10-06 22:01:11 -07:00