This commit is contained in:
2026-03-05 16:54:07 +02:00
commit 609946a5f7
5 changed files with 42 additions and 0 deletions

3
README.md Normal file
View 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
View 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
View 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
View 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

View 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>
```