SSL folder #1

This commit is contained in:
xdrm-brackets 2017-01-18 21:51:05 +01:00
commit a0f2aff23d
7 changed files with 47 additions and 0 deletions

7
ssl/check Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ $# -lt 2 ]; then
echo "missing arguments {in_file} {in_signature}" && exit;
fi;
openssl dgst -sha512 -verify ./keys/key.pub -signature $2 $1;

8
ssl/decrypt Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ $# -lt 2 ]; then
echo "missing arguments {in_encrypted} {out_decrypted}" && exit;
fi;
openssl enc -aes-256-cbc -d -in $1 -out $2;

8
ssl/encrypt Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
if [ $# -lt 2 ]; then
echo "missing arguments {in_file} {out_encrypted}" && exit;
fi;
openssl enc -aes-256-cbc -in $1 -out $2;

8
ssl/keygen Executable file
View File

@ -0,0 +1,8 @@
#!/bin/sh
# create private key (ecdsa:521)
openssl ecparam -genkey -name secp256k1 -noout -out ./keys/key;
# generate public key
openssl ec -in ./keys/key -pubout -out ./keys/key.pub;

5
ssl/keys/key Normal file
View File

@ -0,0 +1,5 @@
-----BEGIN EC PRIVATE KEY-----
MHQCAQEEIG41CO5zSQGJhe+Ft/r8VEZud7baXI7FiQgoSy7cM+1NoAcGBSuBBAAK
oUQDQgAE6ACA5jxI8MXDuFGsXBaslk7vOR4Jq3m2qaYGkFM7o8bEhpil2CgCFOPW
ACOFlMiQEkVU7T/KphK78dyosClHIA==
-----END EC PRIVATE KEY-----

4
ssl/keys/key.pub Normal file
View File

@ -0,0 +1,4 @@
-----BEGIN PUBLIC KEY-----
MFYwEAYHKoZIzj0CAQYFK4EEAAoDQgAE6ACA5jxI8MXDuFGsXBaslk7vOR4Jq3m2
qaYGkFM7o8bEhpil2CgCFOPWACOFlMiQEkVU7T/KphK78dyosClHIA==
-----END PUBLIC KEY-----

7
ssl/sign Executable file
View File

@ -0,0 +1,7 @@
#!/bin/sh
if [ $# -lt 2 ]; then
echo "missing arguments {in_file} {out_signature}" && exit;
fi;
openssl dgst -sha512 -sign ./keys/key -out $2 $1;