eccrypto-scripts
a collection of reusable scripts for elliptic curve cryptography
Last updated 4 years ago by antino .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install eccrypto-scripts 
SYNC missed versions from official npm registry.

eccrypto-scripts

testing
brew install bats
./tests
functions

# decrypt
./decrypt "$private_key" \
          "$input_vector" \
          "$ephemeral_public_key" \
          "$mac" \
          "$cipher_text" > decrypted.json

# or

echo -n $ciphertext | ./decrypt "$private_key" \
              "$input_vector" \
              "$ephemeral_public_key" \
              "$mac" > decrypted.json

# derive
./derive "$private_key" "$public_key" > shared_secret.json

# encrypt
cat my-message.txt | ./encrypt "$public_key" > encrypted.json
# or
./encrypt "$public_key" "$message" > encrypted.json

# sign
cat my-message.txt | ./sign "$private_key" > signature.json
# or
./sign "$private_key" "$message" > signature.json

# verify
cat my-message.txt | ./verify "$public_key" "$signature" > verification.json
# or
./verify "$public_key" \
         "$signature" \
         "$message" > verification.json

# new-keypair
./new-keypair > my-keypair.json
# or
./new-keypair --plain my-keypair.txt
all together now...
# this snippet requires jq (https://github.com/stedolan/jq)
read -r pub_a priv_a <<< $(./bin/new-keypair --plain)
read -r pub_b priv_b <<< $(./bin/new-keypair --plain)
./bin/encrypt $pub_a < file-from-b > encrypted_a
signable_a="${pub_a}|$(cat encrypted_a)"
read -r signature_b <<< $(echo -n $signable_a | ./bin/sign $priv_b | jq -r -c -M '.signature')
echo -n $signable_a | ./bin/verify $pub_b $signature_b
read -r iv_a ep_a ct_a mc_a <<< $(cat encrypted_a | jq -r -c -M '.iv, .ephemPublicKey, .ciphertext, .mac')
echo -n $ct_a | ./bin/decrypt $priv_a $iv_a $ep_a $mc_a

Current Tags

  • 0.2.19                                ...           latest (4 years ago)

20 Versions

  • 0.2.19                                ...           4 years ago
  • 0.2.18                                ...           4 years ago
  • 0.2.17                                ...           4 years ago
  • 0.2.15                                ...           4 years ago
  • 0.2.14                                ...           4 years ago
  • 0.2.12                                ...           4 years ago
  • 0.2.10                                ...           4 years ago
  • 0.2.9                                ...           4 years ago
  • 0.2.8                                ...           4 years ago
  • 0.2.7                                ...           4 years ago
  • 0.2.6                                ...           4 years ago
  • 0.2.5                                ...           4 years ago
  • 0.2.4                                ...           4 years ago
  • 0.2.3                                ...           4 years ago
  • 0.2.2                                ...           4 years ago
  • 0.2.1                                ...           4 years ago
  • 0.2.0                                ...           4 years ago
  • 0.1.2                                ...           4 years ago
  • 0.1.1                                ...           4 years ago
  • 0.1.0                                ...           4 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
None
Dependents (0)
None

Copyright 2014 - 2016 © taobao.org |