Socket
Book a DemoInstallSign in
Socket

eccrypto-scripts

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eccrypto-scripts

a collection of reusable scripts for elliptic curve cryptography

0.2.19
latest
Source
npmnpm
Version published
Weekly downloads
6
-68.42%
Maintainers
1
Weekly downloads
 
Created
Source

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

Keywords

eccrypto

FAQs

Package last updated on 24 Jun 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.