Created
October 31, 2025 15:37
-
-
Save salvatorecapolupo/42fdc07cbff82651dbb72c1c0ff0fac7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # 0. crea un file di testo | |
| mkdir esercitazione123 && cd esercitazione123 | |
| # 1. crea un file di testo | |
| echo "CIAO, questo è un test con RSA" > messaggio.txt | |
| # 2. genera chiavi | |
| openssl genpkey -algorithm RSA -out private.pem -aes256 | |
| openssl rsa -pubout -in private.pem -out public.pem | |
| # 3. cifrare (funziona solo se il file è piccolo) | |
| openssl pkeyutl -encrypt -inkey public.pem -pubin -in messaggio.txt -out messaggio.rsa | |
| # 4. decifrare | |
| openssl pkeyutl -decrypt -inkey private.pem -in messaggio.rsa -out messaggio_decrypted.txt | |
| # 5. verifica | |
| cat messaggio_decrypted.txt |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment