Commit graph

71 commits

Author SHA1 Message Date
Sudhi Herle
1786734c0a Updated dependencies; updated ABI compat 2024-12-18 19:13:24 -08:00
Sudhi Herle
d47a4596ef Remove build timestamp 2024-08-30 09:37:59 -07:00
Sudhi Herle
fc94d7cd7d Updated build script to make reproducible builds
* fixed mk-rel.sh; put all release artifiacts in releases/ dir
* updated vt-proto dependencies
2024-08-29 09:42:16 -07:00
Sudhi Herle
2e6d92c753 Updated build script to parse VCS version# correctly 2024-04-09 14:33:38 -07:00
Sudhi Herle
5c6152b4ed Updated to latest safefile lib - fixed up caller sites. 2024-03-10 12:48:16 -07:00
Sudhi Herle
e3053142f5 Teach sigtool verify to use public key as a command line string (in lieu of a file).
- Reorganized the code a bit and split each of sigtool's
  commands into a separate file.
- Added extra tests to validate verify's new capabilities
- Updated README
2024-01-13 10:34:24 -08:00
Sudhi Herle
d49f732c71 Updated go-mmap; added release script 2024-01-12 13:37:20 -08:00
Sudhi Herle
15053202a1 Updated sigtool to use portable mmap lib 2024-01-07 11:55:21 -08:00
Sudhi Herle
c5400a6b18 Updated x/crypto (security fix) 2023-12-19 10:34:46 -08:00
Sudhi Herle
eae20abd24 Updated to vtproto inlieu of gogo-slick; verified that protobuf enc/dec
are same across both.

* updated 'build' to use new vtproto toolchain;
* updated go.mod to use vtproto
2023-11-23 21:06:30 -08:00
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
a538ac8e5c Don't try to be clever with GoRoot; use what's in the path. 2023-09-10 12:28:49 -07:00
Sudhi Herle
c95515af0e Update dependencies; move go version to 1.20
* update build script to use a diff go-root
* update tests.sh to use diff go-root
* move pflag to opencoff/pflag
* use common lib to parse string size..
2023-03-09 17:20:50 +00:00
Sudhi Herle
bbd7afd496 Updated README 2022-11-15 09:16:06 -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
a428db8feb Added ssh tests 2022-06-05 13:47:07 -07: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
f180079586 Updated README with dependencies 2022-04-27 08:59:18 +05:30
Sudhi Herle
445c13ca6f Closes #5 and #6
- removed spurious check in decrypt() against blocksize
- added additional tests for small sized blocks and inputs smaller than
  the blocksize.
- updated README to capture dependencies (protobuf tools)
2022-04-27 08:54:44 +05:30
Sudhi Herle
bce89dacb0 Updated to go1.18; minor code cleanups; updated dependencies 2022-03-20 20:15:15 -07:00
Sudhi Herle
460f1cf703
Merge pull request #4 from uli-heller/ssh-pubkey
Fixed handling of ssh pubkey files; use regexp to split
2021-11-19 19:57:55 -08:00
Uli Heller
43a9f38592 Fixed handling of ssh pubkey files 2021-11-19 13:10:30 +01:00
Sudhi Herle
81a6522ee7 Fixed bug in makeNonceV2(): use the full salt and use block# as prefix
Updated go.mod to use go-1.17
2021-08-28 20:19:24 -07:00
Sudhi Herle
85ed0d06dd Teach build to work on alpine linux protobuf tools 2021-06-12 21:34:30 -07:00
Sudhi Herle
0658fb75d4 Updated libs to build with go1.16.3 2021-06-12 18:15:59 -07:00
Sudhi Herle
945046a815 v2 of sigtool with some changes:
- aead nonce construction is efficient (replace last 8 bytes of salt
  with encoded block# and chunk-size
- increase aead nonce size to 32 bytes
- refactor errors into a separate file
- update "build" to latest version
- updated README.
2021-05-15 19:35:54 -07:00
Sudhi Herle
3fa0ce0c9c Make encryption a bit more efficient
* don't copy chunksize but encode in-place
* reduce stack allocation of chunksize+seq buffer and reuse output
  buffer
2020-03-24 11:39:04 -07:00
Sudhi Herle
e22fae05f7 Better handling of sender verification
* Sender identity is never shared in the encrypted payload
* Sender signs the data-encryption key via Ed25519 if sender-auth is
  desired; else a "signature" of all zeroes is used. In either case, this
  signature is encrypted with the same data-encryption key.
* cleaned up stale code and updated tests
2020-03-23 10:44:40 -07:00
Sudhi Herle
00542dec02 Major breaking changes: Reworked file encryption scheme
* all encryption now uses ephmeral curve25519 keys
* sender can identify themselves by providing a signing key
* sign/verify now uses a string prefix for calculating checksum of the
  incoming message + known prefix [prevents us from verifying unknown
  blobs]
* encrypt/decrypt key is now expanded with a known prefix _and_ the
  header checksum
* protobuf definition changed to include an encrypted sender
  identification blob (sender public key)
* moved protobuf files into an internal/pb directory
* general code rearrangement to make it easy to find files
* added extra validation for reading all keys
* bumped version to 1.0.0
2020-03-20 17:40:52 -07:00
Sudhi Herle
36410626dd Added docstring to protobuf file 2020-02-15 11:15:38 -08:00
Sudhi Herle
1cd3a94180 Added new io.Reader and io.WriteCloser interface to Decryption and Encryption respectively.
* added test case for streaming read/write
* bumped version#
2020-02-14 18:47:25 -08:00
Sudhi Herle
088f1e9ca2 simplified error handling in Encrypt() 2020-02-02 21:32:16 +05:30
Sudhi Herle
8ed3bff6db Cleaned up chunk header encoding during encrypt/decrypt.
* encrypted chunk header now encodes _only_ plain text length
* the AEAD tag length is implicitly added when reading/writing
* added better sanity checks for short blocks during decrypt
* io.ReadAtLeast() reports ErrUnexpectedEOF for less than a full chunk;
  use this signal correctly
* major version bump to denote header incompatibility
2020-01-29 16:47:14 +05:30
Sudhi Herle
d18b7a05bc minor ver bump 2020-01-23 12:25:01 +05:30
Sudhi Herle
0ba5c8b599 don't die if blksize is too large; clamp it to max allowed. 2020-01-23 12:24:27 +05:30
Sudhi Herle
fbfcd37679 Removed deprecated functions in curve25519
* Replaced ScalarMult()/ScalarBaseMult() with X25519()
* version# bump
2020-01-09 15:19:17 -08:00
Sudhi Herle
f32525a864 THIS IS A BREAKING CHANGE! Private Keys generated by previous versions won't work with this version.
* Refactored the private key protection to use standard AEAD
  construction.
* Fix sanity check of decrypted block length to stay within verified
  bounds
* Cleanup test harness to split into utility file (assert()); cleaned up
  names of test functions.
* Fixed scrypt params to not take too long (N=2^19)
* Updated README with these changes
2020-01-08 09:17:54 -08:00
Sudhi Herle
262a554356 Minor refactoring: header checksum now covers _all_ of the header 2019-12-31 11:39:25 -08:00
Sudhi Herle
374daebb8d Use size parsing option in pflag 2019-11-15 13:26:11 -08:00
Sudhi Herle
48142c5577 Updated go.mod to use new upstream pflag; it now understands unique
abbreviations of long args.
2019-11-09 13:20:33 -08:00
Sudhi Herle
0abbfd37ec Teach dec to run in test-only mode 2019-11-08 10:49:13 -08:00
Sudhi Herle
a9c17988c4 Teach sigtool to mark the last block (eof). 2019-11-07 11:57:01 +01:00
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
b14f9d1e53 Merge branch 'encdec' 2019-10-22 20:12:51 -07:00
Sudhi Herle
817aa7fd6a Added tests for encrypt/decrypt routines. Updated minor version# 2019-10-22 10:06:49 -07:00
Sudhi Herle
a347fdca79 Teach 'sigtool enc' to accept a user defined block size 2019-10-21 13:28:27 -07:00
Sudhi Herle
387c75e791 Ran gofmt on all files; forgot to do that after merging. 2019-10-19 21:12:57 -05:00
Sudhi Herle
d9755bc793 Added helper function to take raw bytes and turn em into keys 2019-10-19 14:58:07 -07:00
Sudhi Herle
3c3c51b5ac Merge branch 'encdec' of github.com:opencoff/sigtool into encdec 2019-10-19 14:42:41 -07:00