0.2.19 • Published 8 years ago

eccrypto-scripts v0.2.19

Weekly downloads
3
License
BSD-3-Clause
Repository
github
Last release
8 years ago

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
0.2.19

8 years ago

0.2.18

8 years ago

0.2.17

8 years ago

0.2.15

8 years ago

0.2.14

8 years ago

0.2.12

8 years ago

0.2.10

8 years ago

0.2.9

8 years ago

0.2.8

8 years ago

0.2.7

8 years ago

0.2.6

8 years ago

0.2.5

8 years ago

0.2.4

8 years ago

0.2.3

8 years ago

0.2.2

8 years ago

0.2.1

8 years ago

0.2.0

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago