init
This commit is contained in:
3
README.md
Normal file
3
README.md
Normal file
@@ -0,0 +1,3 @@
|
||||
# some crypto things
|
||||
|
||||
I will store there info that I can use in the future if I'll need it
|
||||
5
aes-encrypt-decrypt/decrypt.sh
Executable file
5
aes-encrypt-decrypt/decrypt.sh
Executable file
@@ -0,0 +1,5 @@
|
||||
|
||||
KEY_PATH=$1
|
||||
ENCRYPTED=$2
|
||||
|
||||
openssl rsautl -decrypt -inkey $KEY_PATH -in $ENCRYPTED > msg_decrypted
|
||||
6
aes-encrypt-decrypt/encrypt.sh
Executable file
6
aes-encrypt-decrypt/encrypt.sh
Executable file
@@ -0,0 +1,6 @@
|
||||
|
||||
NAME=$1
|
||||
MSG=$2
|
||||
|
||||
openssl rsautl -encrypt -inkey $NAME -pubin -in $MSG -out $MSG.enc
|
||||
|
||||
9
aes-encrypt-decrypt/genkey.sh
Executable file
9
aes-encrypt-decrypt/genkey.sh
Executable file
@@ -0,0 +1,9 @@
|
||||
NAME=$1
|
||||
|
||||
echo ${NAME}_private.pem
|
||||
|
||||
mkdir $NAME
|
||||
|
||||
openssl genrsa -aes128 -out $NAME/${NAME}_private.pem 1024
|
||||
openssl rsa -in $NAME/${NAME}_private.pem -pubout > $NAME/${NAME}_public.pem
|
||||
|
||||
19
aes-encrypt-decrypt/how-to-use.md
Normal file
19
aes-encrypt-decrypt/how-to-use.md
Normal file
@@ -0,0 +1,19 @@
|
||||
|
||||
## generate key via genkey
|
||||
```sh
|
||||
./genkey.sh miko089
|
||||
```
|
||||
you can change `miko089` to any nickname as you want
|
||||
|
||||
## encrypt
|
||||
take public key of another people and
|
||||
```sh
|
||||
./encrypt.sh <key_path> <msg_path>
|
||||
```
|
||||
|
||||
## decrypt
|
||||
take your private key and
|
||||
```sh
|
||||
./decrypt.sh <key_path> <msg_encoded>
|
||||
```
|
||||
|
||||
Reference in New Issue
Block a user