commit 609946a5f74d64df08044e60b0c969e63f1acf5a Author: Mikhail Maliugin Date: Thu Mar 5 16:54:07 2026 +0200 init diff --git a/README.md b/README.md new file mode 100644 index 0000000..f501904 --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +# some crypto things + +I will store there info that I can use in the future if I'll need it diff --git a/aes-encrypt-decrypt/decrypt.sh b/aes-encrypt-decrypt/decrypt.sh new file mode 100755 index 0000000..9c12a73 --- /dev/null +++ b/aes-encrypt-decrypt/decrypt.sh @@ -0,0 +1,5 @@ + +KEY_PATH=$1 +ENCRYPTED=$2 + +openssl rsautl -decrypt -inkey $KEY_PATH -in $ENCRYPTED > msg_decrypted diff --git a/aes-encrypt-decrypt/encrypt.sh b/aes-encrypt-decrypt/encrypt.sh new file mode 100755 index 0000000..230a792 --- /dev/null +++ b/aes-encrypt-decrypt/encrypt.sh @@ -0,0 +1,6 @@ + +NAME=$1 +MSG=$2 + +openssl rsautl -encrypt -inkey $NAME -pubin -in $MSG -out $MSG.enc + diff --git a/aes-encrypt-decrypt/genkey.sh b/aes-encrypt-decrypt/genkey.sh new file mode 100755 index 0000000..d5b4072 --- /dev/null +++ b/aes-encrypt-decrypt/genkey.sh @@ -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 + diff --git a/aes-encrypt-decrypt/how-to-use.md b/aes-encrypt-decrypt/how-to-use.md new file mode 100644 index 0000000..3a2718c --- /dev/null +++ b/aes-encrypt-decrypt/how-to-use.md @@ -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 +``` + +## decrypt +take your private key and +```sh +./decrypt.sh +``` +